N Queens Placement#334

N Queens Placement

1 second
128 megabytes
Medium (≈1350)

There is an n\times n grid on a chessboard. Place queens on the board in such a way that no queen can attack another.

Input

The size of the chessboard is (1 ≤ n ≤ 10).

Output

If it is possible to place all queens such that no queen can attack another, print integers in rows. The integer in the -th row and -th column indicates the cell () on the board and should be if a queen is placed at (), otherwise it should be . If there are multiple ways to place the queens, print any one of them. If it is not possible to place all queens in any arrangement, output Not possible.

Examples

Example 1

Loading
Loading