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