A, B, K = map(int, input().split())
list = []
for i in range(1, max(A, B)+1):
    if A % i == 0 and B % i == 0:
        list.append(i)
    else:
        pass
list = sorted(list, reverse=True)
print(list[K-1]) A, B, K = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B K list = [] list [] for i in range(1, max(A, B)+1):
    if A % i == 0 and B % i == 0:
        list.append(i)
    else:
        pass i range(1, max(A, B)+1) range 1 max(A, B)+1 max(A, B) max A B 1 if A % i == 0 and B % i == 0:
        list.append(i)
    else:
        pass A % i == 0 and B % i == 0 A % i == 0 A % i A i 0 B % i == 0 B % i B i 0 list.append(i) list.append list append i list = sorted(list, reverse=True) list sorted(list, reverse=True) sorted list reverse=True reverse True print(list[K-1]) print list[K-1] list K-1 K 1 list = [] [] list K = map(int, input().split()) map(int, input().split()) K B, K = map(int, input().split()) map(int, input().split()) B list = sorted(list, reverse=True) sorted(list, reverse=True) list A, B, K = map(int, input().split()) map(int, input().split()) A
A, B, K = map(int, input().split())
list = []
for i in range(1, max(A, B)+1):
    if A % i == 0 and B % i == 0:
        list.append(i)
    else:
        pass
list = sorted(list, reverse=True)
print(list[K-1])