A, B, K = (int(i) for i in input().split())
m = []
for i in range(100, 0, -1):
    if (A % i == 0) and (B % i == 0):
        m.append(i)
print(m[K - 1]) int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i A, B, K = (int(i) for i in input().split()) A (int(i) for i in input().split()) B K m = [] m [] for i in range(100, 0, -1):
    if (A % i == 0) and (B % i == 0):
        m.append(i) i range(100, 0, -1) range 100 0 -1 if (A % i == 0) and (B % i == 0):
        m.append(i) (A % i == 0) and (B % i == 0) A % i == 0 A % i A i 0 B % i == 0 B % i B i 0 m.append(i) m.append m append i print(m[K - 1]) print m[K - 1] m K - 1 K 1 K = (int(i) for i in input().split()) (int(i) for i in input().split()) K m = [] [] m B, K = (int(i) for i in input().split()) (int(i) for i in input().split()) B A, B, K = (int(i) for i in input().split()) (int(i) for i in input().split()) A
A, B, K = (int(i) for i in input().split())
m = []
for i in range(100, 0, -1):
    if (A % i == 0) and (B % i == 0):
        m.append(i)
print(m[K - 1])