A, B, K = map(int, input().split())
i, t = 101, 1
while t<=K:
  i -= 1
  if A%i==0 and B%i ==0:
    t += 1
print(i) A, B, K = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B K i, t = 101, 1 i 101 t 1 while t<=K:
  i -= 1
  if A%i==0 and B%i ==0:
    t += 1 t<=K t K i -= 1 i 1 if A%i==0 and B%i ==0:
    t += 1 A%i==0 and B%i ==0 A%i==0 A%i A i 0 B%i ==0 B%i B i 0 t += 1 t 1 print(i) print i t += 1 1 t i, t = 101, 1 101 i A, B, K = map(int, input().split()) map(int, input().split()) A K = map(int, input().split()) map(int, input().split()) K B, K = map(int, input().split()) map(int, input().split()) B t = 101, 1 1 t i -= 1 1 i
A, B, K = map(int, input().split())
i, t = 101, 1
while t<=K:
  i -= 1
  if A%i==0 and B%i ==0:
    t += 1
print(i)