abk = [int(i) for i in input().split()]
a = abk[0]
b = abk[1]
k = abk[2]

anss = []
for i in range(1,min(a,b)+1):
  if a%i==0 and b%i==0:
    anss.append(i)
    
anss.sort(reverse=True)
print(anss[k-1]) int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i abk = [int(i) for i in input().split()] abk [int(i) for i in input().split()] a = abk[0] a abk[0] abk 0 b = abk[1] b abk[1] abk 1 k = abk[2] k abk[2] abk 2 anss = [] anss [] for i in range(1,min(a,b)+1):
  if a%i==0 and b%i==0:
    anss.append(i)
     i range(1,min(a,b)+1) range 1 min(a,b)+1 min(a,b) min a b 1 if a%i==0 and b%i==0:
    anss.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 anss.append(i) anss.append anss append i anss.sort(reverse=True) anss.sort anss sort reverse=True reverse True print(anss[k-1]) print anss[k-1] anss k-1 k 1 k = abk[2] abk[2] k anss = [] [] anss a = abk[0] abk[0] a abk = [int(i) for i in input().split()] [int(i) for i in input().split()] abk b = abk[1] abk[1] b
abk = [int(i) for i in input().split()]
a = abk[0]
b = abk[1]
k = abk[2]

anss = []
for i in range(1,min(a,b)+1):
  if a%i==0 and b%i==0:
    anss.append(i)
    
anss.sort(reverse=True)
print(anss[k-1])
