All tasks
Mediumloopsmath

FizzBuzz

Time limit 2 s · Memory 64 MB

Statement

Given an integer n, for every number from 1 to n print on its own line: "Fizz" if divisible by 3, "Buzz" if by 5, "FizzBuzz" if by both, otherwise the number itself.

Constraints

1 ≤ n ≤ 10^4

Examples

Input 1
5
Output 1
1
2
Fizz
4
Buzz
Solve this task to unlock the editorial.

AI tutor

Stuck? Get a nudge — the tutor explains the idea, it never hands you the solution.