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

output = []
mins = min(a,b)
for divisor in range(1, mins+1):
    if a % divisor == 0 and b % divisor == 0:
        output.append(divisor)
print(output[-k]) a,b,k = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b k output = [] output [] mins = min(a,b) mins min(a,b) min a b for divisor in range(1, mins+1):
    if a % divisor == 0 and b % divisor == 0:
        output.append(divisor) divisor range(1, mins+1) range 1 mins+1 mins 1 if a % divisor == 0 and b % divisor == 0:
        output.append(divisor) a % divisor == 0 and b % divisor == 0 a % divisor == 0 a % divisor a divisor 0 b % divisor == 0 b % divisor b divisor 0 output.append(divisor) output.append output append divisor print(output[-k]) print output[-k] output -k k a,b,k = map(int, input().split()) map(int, input().split()) a k = map(int, input().split()) map(int, input().split()) k output = [] [] output mins = min(a,b) min(a,b) mins b,k = map(int, input().split()) map(int, input().split()) b
a,b,k = map(int, input().split())

output = []
mins = min(a,b)
for divisor in range(1, mins+1):
    if a % divisor == 0 and b % divisor == 0:
        output.append(divisor)
print(output[-k])