a, b, k = map(int, input().split())
t = 100
cnt = 0
while t > 0:
    if a%t == 0 and b%t == 0:
        cnt+=1
        if cnt == k: break
    t-=1
print(t) a, b, k = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b k t = 100 t 100 cnt = 0 cnt 0 while t > 0:
    if a%t == 0 and b%t == 0:
        cnt+=1
        if cnt == k: break
    t-=1 t > 0 t 0 if a%t == 0 and b%t == 0:
        cnt+=1
        if cnt == k: break
     a%t == 0 and b%t == 0 a%t == 0 a%t a t 0 b%t == 0 b%t b t 0 cnt+=1 cnt 1 if cnt == k: break
     cnt == k cnt k t-=1 t 1 print(t) print t t = 100 100 t k = map(int, input().split()) map(int, input().split()) k a, b, k = map(int, input().split()) map(int, input().split()) a cnt = 0 0 cnt b, k = map(int, input().split()) map(int, input().split()) b cnt+=1 1 cnt t-=1 1 t
a, b, k = map(int, input().split())
t = 100
cnt = 0
while t > 0:
    if a%t == 0 and b%t == 0:
        cnt+=1
        if cnt == k: break
    t-=1
print(t)