Vasya and his friends
In the new game "Clossed Loops 7" offers players a checkered table N to M cells. The course consists in the fact that another player draws a loop - closed curve without self-intersections, running only on the sides of the cells. Each cycle can be drawn only once for the entire game (in this case, of course, there is no draw cycles, overlapping with the already painted). Players take turns. Vyigryvat one who draws the last possible cycle. For example, if N = 2, M = 1, then only three cycles, and the player making the third turn, wins:
Vasya called the K-1 friends to play with him. To make an impression, he would want to win. For this he needs to know how the account is a player he must be guaranteed to win. Vasya heard about your success in programming, and for help, he turned it to you.
Input
Given three integers: N, M - the table size (1 ≤ N ≤ 100, 1 ≤ M ≤ 8) and K - the number of players (1 < K ≤ 10^9).
Output
Bring one number from 1 to K - what a player account to be Vasya to win.