cho.sh
Notes
Loading...

Chariots

Time limit

2s

Memory limit

128 MB

Problem

A chariot can move any number of cells horizontally or vertically.

You must place N chariots on an N x N board while satisfying both conditions below.

  1. No two chariots may be in the same row or the same column.
  2. No chariot may be placed on either of the two main diagonals of the board: the diagonal from the top-left corner to the bottom-right corner, or the diagonal from the top-right corner to the bottom-left corner.

Write a program that outputs any placement satisfying the conditions.

Input

The first line contains an integer N (3 <= N <= 100,000).

Output

Print N lines. On the i-th line, print the column number where the chariot in row i is placed.

If more than one placement satisfies the conditions, print any one of them. If no placement is possible, print only -1 on the first line.