Imedians who originate from the planet Imedio love games of the Earth. The FizzBuzz Question is one of the most popular game among them, and is the winner of Imedian Game of the Year 2014.
Its rule is defined in a Wikipedia article as follows:
Fizz buzz is a group word game for children to teach them about division. Players take turns to count incrementally, replacing any number divisible by three with the word “fizz”, and any number divisible by five with the word “buzz”.
[…]
The player designated to go first says the number “1”, and each player thenceforth counts one number in turn. However, any number divisible by three is replaced by the word fizz and any divisible by five by the word buzz. Numbers divisible by both become fizz buzz.
For example, a typical round of fizz buzz would start as follows:
1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz, 16, 17, Fizz, 19, Buzz, Fizz, 22, 23, Fizz, Buzz, 26, Fizz, 28, 29, Fizz Buzz, 31, 32, Fizz, 34, Buzz, Fizz, ...
The only line of the input contains a number \[ N (0 < N < 101000000) \].
If the last Imedian count a number, print the resulting number in a single line. Otherwise, print either “Fizz”, “Buzz”, or “Fizz Buzz” (without quotes, case-sensitive) appropriately in a single line.
5 seconds
3
Fizz
5
Buzz
7
7
15
Fizz Buzz
1999999999999999995
Fizz Buzz
イメディオ星のイメディオ星人は地球のゲームが大好き。中でも FizzBuzz は最も人気のあるゲームで、2014 年のイメディオゲーム大賞を受賞したほどです。
FizzBuzz のルールは Wikipedia の記事 で次のように定義されています。
最初のプレイヤーは「1」と数字を発言する。次のプレイヤーは直前のプレイヤーの次の数字を発言していく。ただし、3で割り切れる場合は 「Fizz」、5で割り切れる場合は 「Buzz」、両者で割り切れる場合は 「Fizz Buzz」を数の代わりに発言しなければならない。
ゲームは、次のように進行します
1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz, 16, 17, Fizz, 19, Buzz, Fizz, 22, 23, Fizz, Buzz, 26, Fizz, 28, 29, Fizz Buzz, 31, 32, Fizz, 34, Buzz, Fizz, ...
答えを 1 行で出力してください。
1 実行あたり 5 秒
英語版の Sample tests を参考にしてください。