A,B,K = map(int,input().split())
print([n for n in range(1,101) if A%n==0 and B%n==0][-K]) A,B,K = map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B K n for n in range(1,101) if A%n==0 and B%n==0 for n in range(1,101) if A%n==0 and B%n==0 n range(1,101) range 1 101 A%n==0 and B%n==0 A%n==0 A%n A n 0 B%n==0 B%n B n 0 if A%n==0 and B%n==0 n print([n for n in range(1,101) if A%n==0 and B%n==0][-K]) print [n for n in range(1,101) if A%n==0 and B%n==0][-K] [n for n in range(1,101) if A%n==0 and B%n==0] -K K K = map(int,input().split()) map(int,input().split()) K A,B,K = map(int,input().split()) map(int,input().split()) A B,K = map(int,input().split()) map(int,input().split()) B
A,B,K = map(int,input().split())
print([n for n in range(1,101) if A%n==0 and B%n==0][-K])