CSES - Knight Moves Grid
  • Time limit: 1.00 s
  • Memory limit: 512 MB

There is a knight on an n×nn \times n chessboard. For each square, print the minimum number of moves the knight needs to do to reach the top-left corner.

Input

The only line has an integer nn.

Output

Print the number of moves for each square.

Constraints

  • 4n10004 \le n \le 1000

Example

Input:

8

Output:

0 3 2 3 2 3 4 5 
3 4 1 2 3 4 3 4 
2 1 4 3 2 3 4 5 
3 2 3 2 3 4 3 4 
2 3 2 3 4 3 4 5 
3 4 3 4 3 4 5 4 
4 3 4 3 4 5 4 5 
5 4 5 4 5 4 5 6