N = gets.to_i if N == 1 puts 1 exit end if N.odd? && N <= 5 puts -1 exit end memo = Array.new(N + 1, false) nums = [] 2.upto(2) do |n| next if memo[n] n.step(N, n) do |v| if not memo[v] memo[v] = true nums << v end end end if nums.size < Rational(N, 2).ceil nums.delete_at(nums.index(6)) nums << 6 nums << 3 end puts nums.join(' ')