A,B,K=map(int,input().split(' '))

common_divisor=[]
for i in range(100,0,-1):
  if A%i==0 and B%i==0:
    common_divisor.append(i)

print(common_divisor[K-1]) A,B,K=map(int,input().split(' ')) A map(int,input().split(' ')) map int input().split(' ') ().split () input split ' ' B K common_divisor=[] common_divisor [] for i in range(100,0,-1):
  if A%i==0 and B%i==0:
    common_divisor.append(i) i range(100,0,-1) range 100 0 -1 if A%i==0 and B%i==0:
    common_divisor.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 common_divisor.append(i) common_divisor.append common_divisor append i print(common_divisor[K-1]) print common_divisor[K-1] common_divisor K-1 K 1 A,B,K=map(int,input().split(' ')) map(int,input().split(' ')) A B,K=map(int,input().split(' ')) map(int,input().split(' ')) B common_divisor=[] [] common_divisor K=map(int,input().split(' ')) map(int,input().split(' ')) K
A,B,K=map(int,input().split(' '))

common_divisor=[]
for i in range(100,0,-1):
  if A%i==0 and B%i==0:
    common_divisor.append(i)

print(common_divisor[K-1])