A,B,K = map(int,input().split())
count = 0
for i in range(1,max(A,B)+1)[::-1]:
  if A%i==0 and B%i==0:
    count += 1
    if count == K:
      break
print(i) A,B,K = map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B K count = 0 count 0 for i in range(1,max(A,B)+1)[::-1]:
  if A%i==0 and B%i==0:
    count += 1
    if count == K:
      break i range(1,max(A,B)+1)[::-1] (1,max(A,B)+1) range 1 max(A,B)+1 max(A,B) max A B 1 ::-1 -1 if A%i==0 and B%i==0:
    count += 1
    if count == K:
      break A%i==0 and B%i==0 A%i==0 A%i A i 0 B%i==0 B%i B i 0 count += 1 count 1 if count == K:
      break count == K count K break print(i) print i count += 1 1 count B,K = map(int,input().split()) map(int,input().split()) B A,B,K = map(int,input().split()) map(int,input().split()) A K = map(int,input().split()) map(int,input().split()) K count = 0 0 count
A,B,K = map(int,input().split())
count = 0
for i in range(1,max(A,B)+1)[::-1]:
  if A%i==0 and B%i==0:
    count += 1
    if count == K:
      break
print(i)