URI Online Judge | 2512

Reverse Game

By Felipe Getúlio, UEA BR Brazil

Timelimit: 2

Have you heard of reverse game? It's very simple. Given a 3x3 matrix, made up of '*' (asterisks) and '-' (dashes), the player's goal is to change the state of the matrix in order to arrive in a valid state , In which all characters in the array are dashes or all are asterisks. The only rule to make some change in the array is as follows: the player chooses a cell from the array, and then the character corresponding to it and the corresponding cells to its adjacent (left, right, above, and below) Value for the opposite character, that is, if there is any '*' character, it will become '-', and if there is '-', '*'. Below, there is a state change example (red cells are the chosen ones).

The multiplayer version of the game takes place in the following way: a match consists of several rounds. In each round, two matrices of the same initial state (chosen at random) are given, one for each player. Players must then simultaneously change the initial state of their matrix (through the changes described above) to a valid final state. The player freely decides which of these states he should reach. Wins a round the player who meets the above goal in fewer steps. A change in the matrix (the changes of the characters corresponding to the chosen cell and adjacent) corresponds to a step in this game. In this way, the amount of characters changed during some state changes does not interfere with the amount of steps reached. A draw in a round occurs when players get the same amount of steps, no matter what final state they have chosen. The player with the most winning rounds wins a match. There is a draw in a match when players have equal amounts of winning rounds.

Ufah! Right. Now that you know the game, you might be able to help my friends. Fred and Jason are really addicted to Reverse Game. They play optimally, that is, they always know, starting from any initial state, how to reach both valid end states with the fewest possible steps. Obviously, they also always choose the path with the least minimum amount of steps. In this way, the draw becomes inevitable!

So, for the game not to be só boring, a little change has been made: Fred and Jason start now with different matrices. In this way, we need you to determine who will win the match in this game format.

Input

Each entry consists of several lines. In the first line, there would be na integer R indicating the number of rounds in a single game. Next, 2*R matrices are described, in the representation shown above, one underneath the other, each pair representing respectively, in the order in which they appear, Fred’s and Jason's initial matrices, corresponding to a round. There is a blank space between two consecutive characters and a blank line separating two consecutive matrices.

Output

A saída é composta por uma linha indicando a mensagem: “Jason wins!”, se Jason ganhar a partida, “Fred wins!”, se Fred ganhar a partida, ou “Its a draw!”, se houver empate na partida.

Input Sample Output Sample

3

- * -

- - -

- * -

- * -

- - *

* * -

* - *

* - *

* - -

- - *

- * -

- * *

- * -

- - *

* - *

- * *

- * *

* - *

Fred wins!