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

min = A if A <= B else B

list = []
for i in range(1, min+1):
    if A % i == 0 and B % i == 0:
        list.append(i)

print(list[len(list)-K]) A, B, K = input().split() A input().split() ().split () input split B K A = int(A) A int(A) int A B = int(B) B int(B) int B K = int(K) K int(K) int K min = A if A <= B else B min A if A <= B else B A <= B A B A B list = [] list [] for i in range(1, min+1):
    if A % i == 0 and B % i == 0:
        list.append(i) i range(1, min+1) range 1 min+1 min 1 if A % i == 0 and B % i == 0:
        list.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 list.append(i) list.append list append i print(list[len(list)-K]) print list[len(list)-K] list len(list)-K len(list) len list K K = input().split() input().split() K list = [] [] list B, K = input().split() input().split() B min = A if A <= B else B A if A <= B else B min A, B, K = input().split() input().split() A K = int(K) int(K) K A = int(A) int(A) A B = int(B) int(B) B
A, B, K = input().split()
A = int(A)
B = int(B)
K = int(K)

min = A if A <= B else B

list = []
for i in range(1, min+1):
    if A % i == 0 and B % i == 0:
        list.append(i)

print(list[len(list)-K])