a,b,k=map(int,input().split())
c=[i for i in range(100,0,-1) if a%i==0 and b%i==0]
print(c[k-1]) a,b,k=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b k i for i in range(100,0,-1) if a%i==0 and b%i==0 for i in range(100,0,-1) if a%i==0 and b%i==0 i range(100,0,-1) range 100 0 -1 a%i==0 and b%i==0 a%i==0 a%i a i 0 b%i==0 b%i b i 0 if a%i==0 and b%i==0 i c=[i for i in range(100,0,-1) if a%i==0 and b%i==0] c [i for i in range(100,0,-1) if a%i==0 and b%i==0] print(c[k-1]) print c[k-1] c k-1 k 1 c=[i for i in range(100,0,-1) if a%i==0 and b%i==0] [i for i in range(100,0,-1) if a%i==0 and b%i==0] c 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
a,b,k=map(int,input().split())
c=[i for i in range(100,0,-1) if a%i==0 and b%i==0]
print(c[k-1])