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