a,b,k = gets.chomp.split.map(&:to_i)

count = 0

100.times do |i|
    if (a % (100 - i) == 0) && (b % (100 - i) == 0)
        count += 1
    end
    if count == k
        puts 100 - i
        break
    end
end
