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

c=min(a,b)
d=max(a,b)
ans=[]

for i in range(c):
    if c%(i+1)==0 and d%(i+1)==0:
        ans.append(i+1)
            
print(ans[-k]) a,b,k=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b k c=min(a,b) c min(a,b) min a b d=max(a,b) d max(a,b) max a b ans=[] ans [] for i in range(c):
    if c%(i+1)==0 and d%(i+1)==0:
        ans.append(i+1)
             i range(c) range c if c%(i+1)==0 and d%(i+1)==0:
        ans.append(i+1)
             c%(i+1)==0 and d%(i+1)==0 c%(i+1)==0 c%(i+1) c i+1 i 1 0 d%(i+1)==0 d%(i+1) d i+1 i 1 0 ans.append(i+1) ans.append ans append i+1 i 1 print(ans[-k]) print ans[-k] ans -k k k=map(int,input().split()) map(int,input().split()) k c=min(a,b) min(a,b) c a,b,k=map(int,input().split()) map(int,input().split()) a b,k=map(int,input().split()) map(int,input().split()) b d=max(a,b) max(a,b) d ans=[] [] ans
a,b,k=map(int,input().split())

c=min(a,b)
d=max(a,b)
ans=[]

for i in range(c):
    if c%(i+1)==0 and d%(i+1)==0:
        ans.append(i+1)
            
print(ans[-k])