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

num = min(a, b)

cnt = 0

while cnt < k:
    if a%num == 0 and b%num == 0:
        cnt += 1
        num -= 1
    else:
        num -= 1
print(num + 1) a, b, k = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b k num = min(a, b) num min(a, b) min a b cnt = 0 cnt 0 while cnt < k:
    if a%num == 0 and b%num == 0:
        cnt += 1
        num -= 1
    else:
        num -= 1 cnt < k cnt k if a%num == 0 and b%num == 0:
        cnt += 1
        num -= 1
    else:
        num -= 1 a%num == 0 and b%num == 0 a%num == 0 a%num a num 0 b%num == 0 b%num b num 0 cnt += 1 cnt 1 num -= 1 num 1 num -= 1 num 1 print(num + 1) print num + 1 num 1 num -= 1 1 num k = map(int, input().split()) map(int, input().split()) k cnt = 0 0 cnt cnt += 1 1 cnt b, k = map(int, input().split()) map(int, input().split()) b num -= 1 1 num a, b, k = map(int, input().split()) map(int, input().split()) a num = min(a, b) min(a, b) num
a, b, k = map(int, input().split())

num = min(a, b)

cnt = 0

while cnt < k:
    if a%num == 0 and b%num == 0:
        cnt += 1
        num -= 1
    else:
        num -= 1
print(num + 1)