integer1, integer2, term = map(int, input().split())
term_value = max(integer1, integer2)
largest_term = 0
while term_value <= 100:
    if integer1 % term_value == 0 and integer2 % term_value == 0:
        largest_term += 1
    if term == largest_term:
        break
    term_value -= 1
print(term_value) integer1, integer2, term = map(int, input().split()) integer1 map(int, input().split()) map int input().split() ().split () input split integer2 term term_value = max(integer1, integer2) term_value max(integer1, integer2) max integer1 integer2 largest_term = 0 largest_term 0 while term_value <= 100:
    if integer1 % term_value == 0 and integer2 % term_value == 0:
        largest_term += 1
    if term == largest_term:
        break
    term_value -= 1 term_value <= 100 term_value 100 if integer1 % term_value == 0 and integer2 % term_value == 0:
        largest_term += 1
     integer1 % term_value == 0 and integer2 % term_value == 0 integer1 % term_value == 0 integer1 % term_value integer1 term_value 0 integer2 % term_value == 0 integer2 % term_value integer2 term_value 0 largest_term += 1 largest_term 1 if term == largest_term:
        break
     term == largest_term term largest_term break term_value -= 1 term_value 1 print(term_value) print term_value largest_term = 0 0 largest_term largest_term += 1 1 largest_term term = map(int, input().split()) map(int, input().split()) term integer1, integer2, term = map(int, input().split()) map(int, input().split()) integer1 term_value -= 1 1 term_value term_value = max(integer1, integer2) max(integer1, integer2) term_value integer2, term = map(int, input().split()) map(int, input().split()) integer2
integer1, integer2, term = map(int, input().split())
term_value = max(integer1, integer2)
largest_term = 0
while term_value <= 100:
    if integer1 % term_value == 0 and integer2 % term_value == 0:
        largest_term += 1
    if term == largest_term:
        break
    term_value -= 1
print(term_value)