A,B,K = map(int,input().split())
div = []

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

for i in range(1,101):
	if A%i == 0 and B%i == 0:
		div.append(i)
print(sorted(div)[-K])
