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

counter = 0
for i in range(min(a, b), 0, -1):
    if a % i == 0 and b % i == 0:
        counter += 1
        if counter == k:
            ans = i
            break

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

counter = 0
for i in range(min(a, b), 0, -1):
    if a % i == 0 and b % i == 0:
        counter += 1
        if counter == k:
            ans = i
            break

print(i)
