Under construction

Still being built. Things may change

Fizz and Buzz

Time limit2sMemory limit256 MB

Summary
Given a sequence of numbers each divisible by 3 or 5, guess for each position whether Fizz (divisible by 3) or Buzz (divisible by 5) produced it, allowing at most 1200 errors.
Level

Medium6 of 10

Topics
Probability, Math, Greedy, Implementation
Solved
No attempts yet

Statement

Two dwarves, Fizz and Buzz, build a sequence of nn integers. Each element is constructed as follows. First, the friends toss a fair coin to choose who creates the next number: with probability 12\frac{1}{2} it is Fizz, and with probability 12\frac{1}{2} it is Buzz. Then, if the toss favors Fizz, he considers all integers from 11 to 10 00010\,000 that are divisible by 33 and selects one of them at random. All these integers are equally likely to be selected. If the toss favors Buzz, he considers all integers from 11 to 10 00010\,000 that are divisible by 55 and selects one of them at random. All these integers are equally likely to be selected as well. All coin tosses and all integer selections are independent events.

The dwarves built a sequence of nn integers by the rules above. Given the resulting sequence, guess who created which number, without making too many errors.

Input

The first line contains an integer nn, the length of the sequence (1≤n≤10 0001 \le n \le 10\,000). The second line contains the sequence itself: the integers a1a_1, a2a_2, …\ldots, ana_n (1≤ai≤10 0001 \le a_i \le 10\,000). It is guaranteed that the sequence was built according to the statement using a random number generator.

Output

Print a single line with nn characters, each of which is either "F" or "B". In the perfect answer, the character at position ii must be "F" if the number aia_i was created by Fizz, or "B" if the number aia_i was created by Buzz. Your answer may contain at most 12001200 errors. In other words, it may differ from the perfect answer at no more than 12001200 positions.

Notes

The example above shows the perfect answer. In this example a solution cannot make more than ten errors, so any correctly formatted answer is accepted.

Examples1

  1. Example 1

    Input
    10
    3216 7770 8448 3438 6255 330 405 5835 6140 7475
    
    Expected output
    FBFFBBFBBB