#! /usr/bin/env python3
a, b, c = map(int, input().split())
t = []
for i in range(1, 101):
    if a%i + b%i < 1: t += [i]
print(t[-c]) a, b, c = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b c t = [] t [] for i in range(1, 101):
    if a%i + b%i < 1: t += [i] i range(1, 101) range 1 101 if a%i + b%i < 1: t += a%i + b%i < 1 a%i + b%i a%i a i b%i b i 1 print(t[-c]) print t[-c] t -c c t = [] [] t b, c = map(int, input().split()) map(int, input().split()) b a, b, c = map(int, input().split()) map(int, input().split()) a c = map(int, input().split()) map(int, input().split()) c
#! /usr/bin/env python3
a, b, c = map(int, input().split())
t = []
for i in range(1, 101):
    if a%i + b%i < 1: t += [i]
print(t[-c])