local n = io.read("*n")
if n == 3 then
  print("2 3 25")
elseif n % 4 == 1 then
  local rep = (n - 1) // 4
  for i = 0, rep - 1 do
    io.write(2 + 6 * i .. " " .. 3 + 6 * i .. " " .. 4 + 6 * i .. " " .. 6 + 6 * i .. " ")
  end
  if n % 8 == 1 then
    print(rep * 6 + 6)
  else
    print(rep * 6 + 3)
  end
elseif n % 4 == 0 then
  local rep = n // 4 - 1
  for i = 0, rep - 1 do
    io.write(2 + 6 * i .. " " .. 3 + 6 * i .. " " .. 4 + 6 * i .. " " .. 6 + 6 * i .. " ")
  end
  io.write(2 + 6 * rep .. " " .. 3 + 6 * rep .. " " .. 4 + 6 * rep .. " ")
  if n % 8 == 0 then
    print(rep * 6 + 6)
  else
    print(rep * 6 + 9)
  end
elseif n % 4 == 2 then
  local rep = (n - 2) // 4
  for i = 0, rep - 1 do
    io.write(2 + 6 * i .. " " .. 3 + 6 * i .. " " .. 4 + 6 * i .. " " .. 6 + 6 * i .. " ")
  end
  if n % 8 == 2 then
    print(2 + 6 * rep .. " " .. 4 + rep * 6)
  else
    print(3 + 6 * rep .. " " .. 6 + rep * 6)
  end
else
  local rep = (n - 3) // 4
  for i = 0, rep - 1 do
    io.write(2 + 6 * i .. " " .. 3 + 6 * i .. " " .. 4 + 6 * i .. " " .. 6 + 6 * i .. " ")
  end
  if n % 8 == 3 then
    print(2 + 6 * rep .. " " .. 4 + rep * 6 .. " " .. 6 + rep * 6)
  else
    print(2 + 6 * rep .. " " .. 3 + rep * 6 .. " " .. 4 + rep * 6)
  end
end
