#K4161. Fizz Buzz

    ID: 26904 Type: Default 1000ms 256MiB

Fizz Buzz

Fizz Buzz

The problem is a classic programming challenge known as Fizz Buzz. Given a positive integer n, you are required to print the numbers from 1 to n each on a new line. However, for multiples of three, print Fizz instead of the number; for multiples of five, print Buzz; and for numbers which are multiples of both three and five, print FizzBuzz. Otherwise, print the number itself.

The rules are summarized as follows in LaTeX format:

\( \text{For each } i \; (1 \le i \le n): \)

  • If \( i \equiv 0 \pmod{15} \) then output FizzBuzz.
  • If \( i \equiv 0 \pmod{3} \) then output Fizz.
  • If \( i \equiv 0 \pmod{5} \) then output Buzz.
  • Otherwise, output the number i as a string.

inputFormat

You are given a single integer n (\(1 \le n \le 10^5\)) from standard input.

outputFormat

Print the result for every number from 1 to n on a new line, following the rules of the Fizz Buzz problem.

## sample
5
1

2 Fizz 4 Buzz

</p>