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

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

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