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

ans_lst = []
for i in range(1,min(A,B)+1):
    if A%i==0 and B%i==0:
        ans_lst += [i]
ans_lst.reverse()
print(ans_lst[K-1]) A,B,K = map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B K ans_lst = [] ans_lst [] for i in range(1,min(A,B)+1):
    if A%i==0 and B%i==0:
        ans_lst += [i] i range(1,min(A,B)+1) range 1 min(A,B)+1 min(A,B) min A B 1 if A%i==0 and B%i==0:
        ans_lst += [i] A%i==0 and B%i==0 A%i==0 A%i A i 0 B%i==0 B%i B i 0 ans_lst += [i] ans_lst [i] i ans_lst.reverse() ans_lst.reverse ans_lst reverse print(ans_lst[K-1]) print ans_lst[K-1] ans_lst K-1 K 1 ans_lst = [] [] ans_lst B,K = map(int,input().split()) map(int,input().split()) B A,B,K = map(int,input().split()) map(int,input().split()) A ans_lst += [i] [i] ans_lst K = map(int,input().split()) map(int,input().split()) K
A,B,K = map(int,input().split())

ans_lst = []
for i in range(1,min(A,B)+1):
    if A%i==0 and B%i==0:
        ans_lst += [i]
ans_lst.reverse()
print(ans_lst[K-1])