#P10506. 魔法珠

魔法珠

Problem Description

Freda and rainbow are students of the School of Magic at Preternatural Kingdom University (PKU). To show the magic they have just learned, they decide to play a game.

At the beginning, there are nn piles of magic beads in front of Freda, and the ii-th pile has aia_i beads. Freda and rainbow take turns to perform the following operation:

  1. Choose any pile among the nn piles whose number of beads is greater than 11. Let the number of beads in this pile be pp. The proper divisors of pp that are less than pp are b1,b2bmb_1, b_2 \cdots b_m, for a total of mm divisors.

  2. Use magic to turn this pile into mm piles, with b1,b2bmb_1, b_2 \cdots b_m beads in each pile respectively.

  3. Choose one pile among these mm piles and use magic to make it disappear.

Note that after one operation, the number of piles increases by m2m - 2, and the total number of beads across all piles may change.

When it is a player's turn, if every pile has exactly 11 bead, then that player loses.

Both Freda and rainbow play with the best strategy, and Freda goes first. Predict who will win.

Input Format

This problem has only one test point and contains multiple test cases, ending at EOF.

For each test case, the first line contains an integer nn.

The second line contains nn integers aia_i.

Output Format

For each test case, assuming both players play optimally, if Freda can win, output freda; if Rainbow can win, output rainbow.

3
2 2 2
3
1 3 5
freda
rainbow

Hint

Constraints: for all testdata, 1n1001 \le n \le 100, 1ai10001 \le a_i \le 1000.

Translated by ChatGPT 5