Simon and Antisimon play a game. Initially each player receives one fixed positive integer that doesn't change throughout the game. Simon receives number *a* and Antisimon receives number *b*. They also have a heap of *n* stones. The players take turns to make a move and Simon starts. During a move a player should take from the heap the number of stones equal to the greatest common divisor of the fixed number he has received and the number of stones left in the heap. A player loses when he cannot take the required number of stones (i. e. the heap has strictly less stones left than one needs to take). 

Your task is to determine by the given *a*, *b* and *n* who wins the game.
The only string contains space-separated integers *a*, *b* and *n* (1 ≤ *a*, *b*, *n* ≤ 100) — the fixed numbers Simon and Antisimon have received correspondingly and the initial number of stones in the pile.
3 5 9
0
1 1 100
1
23 12 16
1
95 26 29
1
73 32 99
1
1 1 1
0
41 12 65
1
13 61 100
1
100 100 10
0
12 24 26
1
73 21 96
1
17 22 81
1
14 88 97
1
42 81 17
0
34 36 19
1
21 87 12
1
97 92 98
1
49 25 62
1
29 17 44
1
10 1 10
0
99 98 100
1
100 100 1
0
11 99 55
0
8 13 21
0
34 55 89
0
21 34 55
1
13 21 34
1
34 21 55
0
10 20 84
1
4 2 5
0
3 2 3
0
31 23 1
0
100 100 100
0
100 1 100
0
1 100 100
1
1 1 100
1
17 23 100
1
99 98 100
1
1 1 2
1
2 1 1
0
1 2 1
0
2 1 2
0
10 10 3
1
2 2 1
0
9 5 1
0
import math
a,b,n=list(map(int,input().split(" ")))
count=0
while n>0:
    if count%2==0:
        print("turn A")
        c=math.gcd(a,n)
    else:
        print("turn B")
        c=math.gcd(b,n)
    n=n-c
    count=count+1
else:
    if count%2==0:
        print(1)
    else:
        print(0)
        
