spoj#IBIGAME. A New Task for Ibrahim
A New Task for Ibrahim
One day Rashad and Mahmud were talking about Nim and other mathematical games while teaching game theory to their students. Ibrahim, as usual, solved all problems after the lecture, so teachers decided to give a hard task to him:
Ziya the ProGamer (yes, you know him from my this problem) and Rafael a.k.a. Farael are playing a game with two piles that have A coins in first one, and B coins in the latter. Of course, Ziya starts first and they take alternating turns making the following moves: The player whose turn is; picks one pile with at least two coins, removes from that pile x coins for some 2 ≤ x ≤ 4, and adds one coin to another pile. Players can choose different x in each move, and who cannot make move loses. As you know, Ziya is ProGamer (don't confuse with Programmer!!), and Rafael is Farael (that special name helps him to make the best move possible!!) they both play perfectly.
Ibrahim thought about a dynamic programming solution for this task but the constraints for the task baffled him. The only idea in his mind is observing the answer, however, he thinks that his solution is not enough for this task, so your help is needed here. Please, answer some queries that Ibrahim wants to know.
Input
The first line of the input consisting of the number of the queries Ibrahim will ask - T (1 ≤ T ≤ 5000). For each query, there are given two numbers, A and B (1 ≤ A, B ≤ 1018; a little long game, huh?) in a separate line.
Output
For each query of Ibrahim, print "Ziya" if Ziya will win the game, "Farael" otherwise, in separate line.
Example
Input:
3 1 5 2 3 4 12
Output:
Ziya Farael Farael
Note: Please, read the statement again (23.06.2018).