12th c++ problem
Little Boy Banku is mad at his teacher, who ate all the sweets in the flat and even went to the neighbours to eat their sweets too. Now Banku's parents brought home a chocolate bar, and, sure enough, School teacher is here already and wants to eat it. However, this time Banku has firmly decided that not a single piece of chocolate will go to this glutton. Banku wants to use his teacher's addiction to the games of chance and suggests playing the following game. A chocolate bar can be considered as a rectangle of square units arranged in m rows and n columns and separated by lines . Two players take alternate turns. At his turn, a player must take one piece of chocolate and split it into two along one of the lines. If a player can't make a legal move (which happens when all pieces of chocolate consist of a single unit square), he loses, and the winner takes all the chocolate. But the teacher is smart enough! He immediately understood who should make the first turn in order for teacher to win, assuming that players take optimal turns. Can you guess that?
Input
First line of input contains number of test cases. The second line of the input contains space-separated integers m and n (1 <= m, n <= 50).
Output
For each test case If teacher should start the game in order to win, output "[:=[first]" otherwise, output "[second]=:]".
Example
Input:
3
2 4
1 3
2 9
Output:
[:=[first]
[second]=:]
[:=[first]
Input
First line of input contains number of test cases. The second line of the input contains space-separated integers m and n (1 <= m, n <= 50).
Output
For each test case If teacher should start the game in order to win, output "[:=[first]" otherwise, output "[second]=:]".
Example
Input:
3
2 4
1 3
2 9
Output:
[:=[first]
[second]=:]
[:=[first]
0