import numpy as np
a,b,k = map(int,input().split())
c = np.gcd(a,b)
print([i for i in range(1,c+1) if c%i==0][-k]) import numpy as np numpy a,b,k = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b k c = np.gcd(a,b) c np.gcd(a,b) np.gcd np gcd a b i for i in range(1,c+1) if c%i==0 for i in range(1,c+1) if c%i==0 i range(1,c+1) range 1 c+1 c 1 c%i==0 c%i c i 0 if c%i==0 i print([i for i in range(1,c+1) if c%i==0][-k]) print [i for i in range(1,c+1) if c%i==0][-k] [i for i in range(1,c+1) if c%i==0] -k k b,k = map(int,input().split()) map(int,input().split()) b k = map(int,input().split()) map(int,input().split()) k a,b,k = map(int,input().split()) map(int,input().split()) a c = np.gcd(a,b) np.gcd(a,b) c
import numpy as np
a,b,k = map(int,input().split())
c = np.gcd(a,b)
print([i for i in range(1,c+1) if c%i==0][-k])