N = gets.to_i ans = [*0..N] checked = Hash.new(false) 1.upto(N) do |i| n = 1 max_v = 0 while (n + 1) ** 2 * i <= N n += 1 max_v = n * n * i if !checked[n * n * i] end if Math.sqrt(i).to_i ** 2 == i while (n + 1) ** 2 < N n += 1 max_v = n * n if !checked[n * n] end end checked[max_v] = true if max_v > i ans[i], ans[max_v] = ans[max_v], ans[i] end end puts ans[1..].join(' ')