a,b,k=map(int,input().split())
m = min(a,b)
l = set()
for i in range(1,m+1):
  if a%i == 0 and b%i == 0:
    l.add(i)

print(sorted(list(l))[-k]) a,b,k=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b k m = min(a,b) m min(a,b) min a b l = set() l set() set for i in range(1,m+1):
  if a%i == 0 and b%i == 0:
    l.add(i) i range(1,m+1) range 1 m+1 m 1 if a%i == 0 and b%i == 0:
    l.add(i) a%i == 0 and b%i == 0 a%i == 0 a%i a i 0 b%i == 0 b%i b i 0 l.add(i) l.add l add i print(sorted(list(l))[-k]) print sorted(list(l))[-k] (list(l)) sorted list(l) list l -k k l = set() set() l k=map(int,input().split()) map(int,input().split()) k m = min(a,b) min(a,b) m 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())
m = min(a,b)
l = set()
for i in range(1,m+1):
  if a%i == 0 and b%i == 0:
    l.add(i)

print(sorted(list(l))[-k])