a,b,k = map(int,input().split())
c = min(a,b)
list = []

for ci in range(1,c+1):
    if a % ci == 0 and b % ci == 0:
        list.append(ci)
print(list[-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 list = [] list [] for ci in range(1,c+1):
    if a % ci == 0 and b % ci == 0:
        list.append(ci) ci range(1,c+1) range 1 c+1 c 1 if a % ci == 0 and b % ci == 0:
        list.append(ci) a % ci == 0 and b % ci == 0 a % ci == 0 a % ci a ci 0 b % ci == 0 b % ci b ci 0 list.append(ci) list.append list append ci print(list[-k]) print list[-k] list -k k c = min(a,b) min(a,b) c list = [] [] list k = map(int,input().split()) map(int,input().split()) k a,b,k = map(int,input().split()) map(int,input().split()) a b,k = map(int,input().split()) map(int,input().split()) b
a,b,k = map(int,input().split())
c = min(a,b)
list = []

for ci in range(1,c+1):
    if a % ci == 0 and b % ci == 0:
        list.append(ci)
print(list[-k])