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


cd=[]
for i in range(1,max(a,b)+1):
    if a%i ==0 and b%i ==0:
        cd.append(i)


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


cd=[]
for i in range(1,max(a,b)+1):
    if a%i ==0 and b%i ==0:
        cd.append(i)


cd = sorted(cd,reverse=True)
print(cd[k-1])

