#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 piles of magic beads in front of Freda, and the -th pile has beads. Freda and rainbow take turns to perform the following operation:
-
Choose any pile among the piles whose number of beads is greater than . Let the number of beads in this pile be . The proper divisors of that are less than are , for a total of divisors.
-
Use magic to turn this pile into piles, with beads in each pile respectively.
-
Choose one pile among these piles and use magic to make it disappear.
Note that after one operation, the number of piles increases by , and the total number of beads across all piles may change.
When it is a player's turn, if every pile has exactly 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 .
The second line contains integers .
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, , .
Translated by ChatGPT 5