require "prime" S = 5 N = gets.to_i primes = Prime.take(S + N - 1) base_primes = primes[0, S] base_qs = base_primes.map { |p| a = [1] x = p while x < 100000000 a << x x *= p end a } bases = base_qs.inject { |x, y| x.product(y).map { |a, b| a * b } } bases.sort! gcds = primes[S, N - 1].reverse A = [1] * N (0 ... N - 1).each do |i| g = gcds[i] A[i] *= g A[i + 1] *= g end (1...N).each do |i| A[i] *= bases.find { |x| A[i - 1].gcd(x) == 1 && A[i - 1] < A[i] * x } end puts A.join(" ")