a,b,k = map( int,input().split() )

i = min(a,b)
ans = 0
while 1:
  if not(a % i)  and not(b % i):
    ans += 1
  if ans == k:
    break
  i -= 1

print(i) a,b,k = map( int,input().split() ) a map( int,input().split() ) map int input().split() ().split () input split b k i = min(a,b) i min(a,b) min a b ans = 0 ans 0 while 1:
  if not(a % i)  and not(b % i):
    ans += 1
  if ans == k:
    break
  i -= 1 1 if not(a % i)  and not(b % i):
    ans += 1
   not(a % i)  and not(b % i) not(a % i) a % i a i not(b % i) b % i b i ans += 1 ans 1 if ans == k:
    break
   ans == k ans k break i -= 1 i 1 print(i) print i b,k = map( int,input().split() ) map( int,input().split() ) b k = map( int,input().split() ) map( int,input().split() ) k ans += 1 1 ans i = min(a,b) min(a,b) i i -= 1 1 i ans = 0 0 ans a,b,k = map( int,input().split() ) map( int,input().split() ) a
a,b,k = map( int,input().split() )

i = min(a,b)
ans = 0
while 1:
  if not(a % i)  and not(b % i):
    ans += 1
  if ans == k:
    break
  i -= 1

print(i)
