A, B, C = input().strip().split()
A, B, C = [int(A), int(B), int(C)]

L=[]
for i in range(min(A,B)):
    if A%(i+1) == 0 and B%(i+1) == 0:
        L.append(i+1)
print(L[len(L)-C]) A, B, C = input().strip().split() A input().strip().split() ().strip().split ().strip() ().strip () input strip split B C A, B, C = [int(A), int(B), int(C)] A [int(A), int(B), int(C)] int(A) int A int(B) int B int(C) int C B C L=[] L [] for i in range(min(A,B)):
    if A%(i+1) == 0 and B%(i+1) == 0:
        L.append(i+1) i range(min(A,B)) range min(A,B) min A B if A%(i+1) == 0 and B%(i+1) == 0:
        L.append(i+1) A%(i+1) == 0 and B%(i+1) == 0 A%(i+1) == 0 A%(i+1) A i+1 i 1 0 B%(i+1) == 0 B%(i+1) B i+1 i 1 0 L.append(i+1) L.append L append i+1 i 1 print(L[len(L)-C]) print L[len(L)-C] L len(L)-C len(L) len L C A, B, C = [int(A), int(B), int(C)] [int(A), int(B), int(C)] A C = input().strip().split() input().strip().split() C L=[] [] L B, C = input().strip().split() input().strip().split() B B, C = [int(A), int(B), int(C)] [int(A), int(B), int(C)] B C = [int(A), int(B), int(C)] [int(A), int(B), int(C)] C A, B, C = input().strip().split() input().strip().split() A
A, B, C = input().strip().split()
A, B, C = [int(A), int(B), int(C)]

L=[]
for i in range(min(A,B)):
    if A%(i+1) == 0 and B%(i+1) == 0:
        L.append(i+1)
print(L[len(L)-C])