MM = input().split()
A = int(MM[0])
B = int(MM[1])
K = int(MM[2])
list1 =[]
for i in range(1,101):
  if A%i ==0 and B%i ==0:
    list1.append(i)
print(list1[-K]) MM = input().split() MM input().split() ().split () input split A = int(MM[0]) A int(MM[0]) int MM[0] MM 0 B = int(MM[1]) B int(MM[1]) int MM[1] MM 1 K = int(MM[2]) K int(MM[2]) int MM[2] MM 2 list1 =[] list1 [] for i in range(1,101):
  if A%i ==0 and B%i ==0:
    list1.append(i) i range(1,101) range 1 101 if A%i ==0 and B%i ==0:
    list1.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 list1.append(i) list1.append list1 append i print(list1[-K]) print list1[-K] list1 -K K list1 =[] [] list1 MM = input().split() input().split() MM A = int(MM[0]) int(MM[0]) A B = int(MM[1]) int(MM[1]) B K = int(MM[2]) int(MM[2]) K
MM = input().split()
A = int(MM[0])
B = int(MM[1])
K = int(MM[2])
list1 =[]
for i in range(1,101):
  if A%i ==0 and B%i ==0:
    list1.append(i)
print(list1[-K])
