#P10506. Magic Beads Game

    ID: 12521 Type: Default 1000ms 256MiB

Magic Beads Game

Magic Beads Game

Freda and rainbow are students at the magic academy of Preternatural Kingdom University (PKU). To showcase their newly learned magic, they decide to engage in a duel. Initially, there are \(n\) piles of magic beads; the \(i\)th pile contains \(a_i\) beads. Players take turns performing the following operation on a pile:

  1. Select any pile with more than one bead. Let the number of beads in the chosen pile be \(p\). Denote by \(b_1, b_2, \ldots, b_m\) all proper divisors of \(p\) (i.e. divisors strictly less than \(p\)).
  2. Apply magic to split this pile into \(m\) piles, where the \(j\)th new pile has \(b_j\) beads.
  3. Choose one of these \(m\) piles and make it vanish.

Note that after one operation, the total number of piles increases by \(m-2\) and the total number of beads may change.

If a player is about to move but all piles consist of exactly one bead, that player loses. Freda moves first and both players play optimally. Determine who wins the game.

inputFormat

The first line contains a single integer \(n\) representing the number of piles.

The second line contains \(n\) space-separated positive integers \(a_1, a_2, \ldots, a_n\) where each \(a_i\) denotes the number of beads in the \(i\)th pile.

outputFormat

Output a single line containing the name of the winner. Print Freda if Freda wins, or rainbow otherwise.

sample

1
1
rainbow

</p>