This page is still under construction.

Parts of this page are still being built. What you see may change.

FizzBuzz

Interview

Time limit1sMemory limit512 MB

Summary
Print the numbers 1 through N, writing Fizz for multiples of X, Buzz for multiples of Y, and FizzBuzz for multiples of both.
Level

Easy1 of 10

Topics
Implementation, Math, Brute force, Simulation
Solved
No attempts yet

Problem

According to Wikipedia, FizzBuzz is a word game that teaches children about division. That may or may not be true, but the question is commonly used to torment fresh computer science graduates in programming interviews.

The rule is simple. Print the integers from 11 to NN in order, replacing every multiple of XX with Fizz and every multiple of YY with Buzz. A number that is a multiple of both XX and YY is printed as FizzBuzz.

Input

The first line contains three integers XX, YY and NN separated by spaces (1≤X<Y≤N≤1001 \le X < Y \le N \le 100).

Output

Print the integers from 11 to NN in order, one per line. Replace the multiples of XX with Fizz, the multiples of YY with Buzz, and the multiples of both XX and YY with FizzBuzz.

Examples3

  1. Example 1

    Input
    2 3 7
    
    Expected output
    1
    Fizz
    Buzz
    Fizz
    5
    FizzBuzz
    7
    
  2. Example 2

    Input
    2 4 7
    
    Expected output
    1
    Fizz
    3
    FizzBuzz
    5
    Fizz
    7
    
  3. Example 3

    Input
    3 5 7
    
    Expected output
    1
    2
    Fizz
    4
    Buzz
    Fizz
    7