a,b,k=map(int,input().split())
N=[]
for i in range(100):
    if a%(i+1)==0 and b%(i+1)==0:
        N.append(i+1)
N.sort(reverse=True)
print(N[k-1]) a,b,k=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b k N=[] N [] for i in range(100):
    if a%(i+1)==0 and b%(i+1)==0:
        N.append(i+1) i range(100) range 100 if a%(i+1)==0 and b%(i+1)==0:
        N.append(i+1) a%(i+1)==0 and b%(i+1)==0 a%(i+1)==0 a%(i+1) a i+1 i 1 0 b%(i+1)==0 b%(i+1) b i+1 i 1 0 N.append(i+1) N.append N append i+1 i 1 N.sort(reverse=True) N.sort N sort reverse=True reverse True print(N[k-1]) print N[k-1] N k-1 k 1 k=map(int,input().split()) map(int,input().split()) k N=[] [] N b,k=map(int,input().split()) map(int,input().split()) b a,b,k=map(int,input().split()) map(int,input().split()) a
a,b,k=map(int,input().split())
N=[]
for i in range(100):
    if a%(i+1)==0 and b%(i+1)==0:
        N.append(i+1)
N.sort(reverse=True)
print(N[k-1])