beecrowd | 2031

Rock, Paper, Airstrike

By Jeremias Gomes, Universidade de Brasília BR Brazil

Timelimit: 1

Rock, Paper, Airstrike is a very popular children’s game, in which two or more children form a circle and do hand gestures in an attempt to get the victory. The rules are surprisingly complex for a children’s game, but it’s still quite popular around the world.

The games are very simple. Players can choose between the sign of a Rock (fist), the sign of a paper (an open palm), and the signal to the Air Attack (like the paper, but with only the thumb and little finger extended).

A game with two players have the following rules to determine a winner:

Your task is to write a program that given the choice of two players tell who won the game.

Input

The input consist of N (1 ≤ N ≤ 1000) test cases. N should be read in the first line of input. Each test case is composed of two lines each containing a string. The first string is the sign chosen by Player 1 and the second string is the sign chosen by the Player 2. These string can be:

Output

The output must be contain:

Each output of a test case must be in one line.

Input Sample Output Sample

2
pedra
pedra
ataque
papel

Sem ganhador
Jogador 1 venceu