import math
a,b,c=map(int,input().split())
d=math.gcd(a,b)
for i in range(d,0,-1):
  if d%i==0:
    c-=1
    if c==0:
      print(i)
      break import math math a,b,c=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b c d=math.gcd(a,b) d math.gcd(a,b) math.gcd math gcd a b for i in range(d,0,-1):
  if d%i==0:
    c-=1
    if c==0:
      print(i)
      break i range(d,0,-1) range d 0 -1 if d%i==0:
    c-=1
    if c==0:
      print(i)
      break d%i==0 d%i d i 0 c-=1 c 1 if c==0:
      print(i)
      break c==0 c 0 print(i) print i break a,b,c=map(int,input().split()) map(int,input().split()) a c=map(int,input().split()) map(int,input().split()) c d=math.gcd(a,b) math.gcd(a,b) d c-=1 1 c b,c=map(int,input().split()) map(int,input().split()) b
import math
a,b,c=map(int,input().split())
d=math.gcd(a,b)
for i in range(d,0,-1):
  if d%i==0:
    c-=1
    if c==0:
      print(i)
      break