int1, int2, rank = map(int, input().split())
kouyaku_list = []
for i in range(1, 100 + 1):
    if int1 % i == 0 and int2 % i == 0:
        kouyaku_list.append(i)

print(kouyaku_list[-rank]) int1, int2, rank = map(int, input().split()) int1 map(int, input().split()) map int input().split() ().split () input split int2 rank kouyaku_list = [] kouyaku_list [] for i in range(1, 100 + 1):
    if int1 % i == 0 and int2 % i == 0:
        kouyaku_list.append(i) i range(1, 100 + 1) range 1 100 + 1 100 1 if int1 % i == 0 and int2 % i == 0:
        kouyaku_list.append(i) int1 % i == 0 and int2 % i == 0 int1 % i == 0 int1 % i int1 i 0 int2 % i == 0 int2 % i int2 i 0 kouyaku_list.append(i) kouyaku_list.append kouyaku_list append i print(kouyaku_list[-rank]) print kouyaku_list[-rank] kouyaku_list -rank rank kouyaku_list = [] [] kouyaku_list int1, int2, rank = map(int, input().split()) map(int, input().split()) int1 rank = map(int, input().split()) map(int, input().split()) rank int2, rank = map(int, input().split()) map(int, input().split()) int2
int1, int2, rank = map(int, input().split())
kouyaku_list = []
for i in range(1, 100 + 1):
    if int1 % i == 0 and int2 % i == 0:
        kouyaku_list.append(i)

print(kouyaku_list[-rank])