a, b, k = (int(i) for i in input().split())
list_ComDiv = []
for i in range(1, min(a, b) + 1):
    if a % i == 0 and b % i == 0:
        list_ComDiv.append(i)
list_ans = sorted(list_ComDiv, reverse=True)
print(list_ans[k - 1]) int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i a, b, k = (int(i) for i in input().split()) a (int(i) for i in input().split()) b k list_ComDiv = [] list_ComDiv [] for i in range(1, min(a, b) + 1):
    if a % i == 0 and b % i == 0:
        list_ComDiv.append(i) i range(1, min(a, b) + 1) range 1 min(a, b) + 1 min(a, b) min a b 1 if a % i == 0 and b % i == 0:
        list_ComDiv.append(i) a % i == 0 and b % i == 0 a % i == 0 a % i a i 0 b % i == 0 b % i b i 0 list_ComDiv.append(i) list_ComDiv.append list_ComDiv append i list_ans = sorted(list_ComDiv, reverse=True) list_ans sorted(list_ComDiv, reverse=True) sorted list_ComDiv reverse=True reverse True print(list_ans[k - 1]) print list_ans[k - 1] list_ans k - 1 k 1 b, k = (int(i) for i in input().split()) (int(i) for i in input().split()) b k = (int(i) for i in input().split()) (int(i) for i in input().split()) k list_ComDiv = [] [] list_ComDiv a, b, k = (int(i) for i in input().split()) (int(i) for i in input().split()) a list_ans = sorted(list_ComDiv, reverse=True) sorted(list_ComDiv, reverse=True) list_ans
a, b, k = (int(i) for i in input().split())
list_ComDiv = []
for i in range(1, min(a, b) + 1):
    if a % i == 0 and b % i == 0:
        list_ComDiv.append(i)
list_ans = sorted(list_ComDiv, reverse=True)
print(list_ans[k - 1])