a, b, k = [int(x) for x in input().split()]

divisors = []
for x in range(1, max(a, b)+1):
  if a % x == 0 and b % x == 0:
    divisors.append(x)

divisors.reverse()
print(divisors[k-1]) 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 divisors = [] divisors [] for x in range(1, max(a, b)+1):
  if a % x == 0 and b % x == 0:
    divisors.append(x) x range(1, max(a, b)+1) range 1 max(a, b)+1 max(a, b) max a b 1 if a % x == 0 and b % x == 0:
    divisors.append(x) a % x == 0 and b % x == 0 a % x == 0 a % x a x 0 b % x == 0 b % x b x 0 divisors.append(x) divisors.append divisors append x divisors.reverse() divisors.reverse divisors reverse print(divisors[k-1]) print divisors[k-1] divisors k-1 k 1 k = [int(x) for x in input().split()] [int(x) for x in input().split()] k b, k = [int(x) for x in input().split()] [int(x) for x in input().split()] b divisors = [] [] divisors a, b, k = [int(x) for x in input().split()] [int(x) for x in input().split()] a
a, b, k = [int(x) for x in input().split()]

divisors = []
for x in range(1, max(a, b)+1):
  if a % x == 0 and b % x == 0:
    divisors.append(x)

divisors.reverse()
print(divisors[k-1])