Graph Tournament#4650

Graph Tournament

1 second
256 megabytes
Very hard

In this task, you need to construct a tournament graph with vertices, ensuring that the shortest path between any two vertices is no longer than two edges.

A directed graph without loops is termed a tournament if there is exactly one directed edge (in one of the two possible directions) between every pair of distinct vertices.

Input

The first line contains a single integer (3 \le n \le 1000) — the number of vertices in the graph.

Output

Output if no graph meets the specified conditions.

Otherwise, output lines, each containing numbers separated by spaces, representing the adjacency matrix of the tournament. Assume the vertices are numbered from to . Here, a_{v,u} = 0 indicates no edge from vertex to vertex , and a_{v,u} = 1 indicates the presence of an edge.

Since the graph must be a tournament, the following conditions must be satisfied:

  • a_{v,u} + a_{u,v} = 1 for all , (1 \le v, u \le n, v \ne u);

  • a_{v,v} = 0 for all (1 \le v \le n).

Examples

Example 1

Loading
Loading