a, b, x = map(int, input().split())
count = 0
for i in range(max(a,b),0,-1):
    if a % i == 0 and b % i == 0:
        count += 1
    if count == x:
        break
print(i) a, b, x = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b x count = 0 count 0 for i in range(max(a,b),0,-1):
    if a % i == 0 and b % i == 0:
        count += 1
    if count == x:
        break i range(max(a,b),0,-1) range max(a,b) max a b 0 -1 if a % i == 0 and b % i == 0:
        count += 1
     a % i == 0 and b % i == 0 a % i == 0 a % i a i 0 b % i == 0 b % i b i 0 count += 1 count 1 if count == x:
        break count == x count x break print(i) print i a, b, x = map(int, input().split()) map(int, input().split()) a count += 1 1 count b, x = map(int, input().split()) map(int, input().split()) b count = 0 0 count x = map(int, input().split()) map(int, input().split()) x
a, b, x = map(int, input().split())
count = 0
for i in range(max(a,b),0,-1):
    if a % i == 0 and b % i == 0:
        count += 1
    if count == x:
        break
print(i)