Compromising Painters

View as PDF

Submit solution


Points: 12
Time limit: 1.0s
Memory limit: 64M

Problem types

All offices in CHolding central building are to be painted. But mischief is afoot among the board of directors: Ozi and Mecem can't agree with what color the walls should be! Eventually, they agree on a fair game:

Ozi starts the game by painting any 2x2 block on the \(\mathbf{N} \times \mathbf{M}\) rectangular wall to light lilac. After Ozi, it's Mecem's turn. Mecem paints any single cell into yellow. To keep the game friendly, they do not paint over cells the other player has already painted. When there are no legal areas a player can paint, they may pass their turn to the other. The game continues until the wall is completely painted. The game starts from the beginning with another wall shortly after!

Both our painters follow the optimal strategy to paint the most area they can. Can you tell who will end up painting the most area for each wall?

Above we see the initial state and first three turns of the paint chess. After this point, since Ozi has no legal moves left they pass the rest of their turns to Mecem until all of the uncovered areas are painted as well.

Input:

First line has a single integer \(\mathbf{D}\), the number of walls to be painted through our game. Following \(\mathbf{D}\) lines each has 2 integers, \(\mathbf{N}\) and \(\mathbf{M}\) , the dimensions of the respective wall.

Batch #1:
  • \(1 \leq \mathbf{N} , \mathbf{M}, \mathbf{D} \leq 100\)
Batch #2:
  • \(1 \leq \mathbf{D} \leq 10^{5} \)
  • \(1 \leq \mathbf{N} , \mathbf{M} \leq 10^9\)

Output:

For each wall, print the color that occupies the most area on the wall. Output "ozi" for lila and output "mecem" for yellow, but do not include the quotations. Output "yes" when both colors occupy the same area on the wall, again without the quotation marks.

Samples

Input:

3
2 2
4 5
4 4

Output:

ozi
mecem
yes

Input:

2
3 3
10 10

Output:

mecem
ozi