# coding: utf-8

A, B, K = map(int, input().split(" "))

ko_yakusu = []
for i in range(1, 101):
    if (A % i == 0) and (B % i == 0):
        ko_yakusu.append(i)

print(ko_yakusu[-K]) A, B, K = map(int, input().split(" ")) A map(int, input().split(" ")) map int input().split(" ") ().split () input split " " B K ko_yakusu = [] ko_yakusu [] for i in range(1, 101):
    if (A % i == 0) and (B % i == 0):
        ko_yakusu.append(i) i range(1, 101) range 1 101 if (A % i == 0) and (B % i == 0):
        ko_yakusu.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 ko_yakusu.append(i) ko_yakusu.append ko_yakusu append i print(ko_yakusu[-K]) print ko_yakusu[-K] ko_yakusu -K K B, K = map(int, input().split(" ")) map(int, input().split(" ")) B A, B, K = map(int, input().split(" ")) map(int, input().split(" ")) A ko_yakusu = [] [] ko_yakusu K = map(int, input().split(" ")) map(int, input().split(" ")) K
# coding: utf-8

A, B, K = map(int, input().split(" "))

ko_yakusu = []
for i in range(1, 101):
    if (A % i == 0) and (B % i == 0):
        ko_yakusu.append(i)

print(ko_yakusu[-K])
