a,b,k=map(int,input().split())
l=[0]
for i in range(1,min(a,b)+1):
    if a%i==0 and b%i==0:
        l.append(i)
l.sort()
l.reverse()
print(l[k-1]) a,b,k=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b k l=[0] l [0] 0 for i in range(1,min(a,b)+1):
    if a%i==0 and b%i==0:
        l.append(i) i range(1,min(a,b)+1) range 1 min(a,b)+1 min(a,b) min a b 1 if a%i==0 and b%i==0:
        l.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 l.append(i) l.append l append i l.sort() l.sort l sort l.reverse() l.reverse l reverse print(l[k-1]) print l[k-1] l k-1 k 1 l=[0] [0] l 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())
l=[0]
for i in range(1,min(a,b)+1):
    if a%i==0 and b%i==0:
        l.append(i)
l.sort()
l.reverse()
print(l[k-1])