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