a, b, k = map(int, input().split())

cds = []
for i in range(1, 101):
    if (a % i == 0) and (b % i == 0):
        cds.append(i)
cds.reverse()
print(cds[k - 1]) a, b, k = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b k cds = [] cds [] for i in range(1, 101):
    if (a % i == 0) and (b % i == 0):
        cds.append(i) i range(1, 101) range 1 101 if (a % i == 0) and (b % i == 0):
        cds.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 cds.append(i) cds.append cds append i cds.reverse() cds.reverse cds reverse print(cds[k - 1]) print cds[k - 1] cds k - 1 k 1 cds = [] [] cds k = map(int, input().split()) map(int, input().split()) k a, b, k = map(int, input().split()) map(int, input().split()) a b, k = map(int, input().split()) map(int, input().split()) b
a, b, k = map(int, input().split())

cds = []
for i in range(1, 101):
    if (a % i == 0) and (b % i == 0):
        cds.append(i)
cds.reverse()
print(cds[k - 1])
