Олимпиадный тренинг

Задача 33299. Chocolate - reboot


Задача

Темы: Простые игры
Recall the contents of the first series. Two people play this game: in front of them is an NxM chocolate bar. During a turn, you can break the existing piece of chocolate along one of the sides into 2 "non-empty" ones.
 
However, you can't break pieces no larger than 1k (pieces can be rotated; we consider one piece "at most" another if it is equal to it or part of it). Thus, it is impossible to break pieces of size 11, 12, , 1k, but other pieces can be broken.
 
Now the pieces that cannot be broken can be eaten (no more than one at a time).
 
In one move, you can either break a piece of a suitable size, or eat it.
 
The one who cannot make a move loses. Determine who will be the winner in the game if the initial dimensions of the chocolate are known.
 
Input
Enter integers 0 < N, M, K <= 100.
 
Output
Print 1 or 2 - the number of the player who will win if the game is correct.

Enter Output
1 1 1 1
1 1 100 1