Fast Travel Coloring

7n개의 정점을 가진 완전 그래프의 간선을 n가지 색으로 칠하되, 임의의 두 정점이 각 색마다 길이 2 이하의 단색 경로로 연결되도록 하는 구성법을 출력한다.

어려움8조합론그래프수학구현아직 제출이 없습니다시간 제한2초메모리 제한256 MB

문제

You are given a complete undirected graph with 7n7n vertices (here nn is a positive integer). Your task is to paint its edges in nn colors in such a way that for each pair of vertices and each color there is a path of at most two edges of this color connecting this pair of vertices. More formally, for each pair of vertices u,vu, v and each color cc at least one of the two options should hold:

  • the edge between uu and vv has color cc;
  • there is a vertex ww that both edges (u,w)(u, w) and (w,v)(w, v) have color cc.

입력

The only line of input contains a positive integer nn (77n10007\leqslant 7n\leqslant 1000).

출력

Let us number the colors from 11 to nn. Let c_i,jc\_{i, j} be 00 if i=ji = j, and the color of the edge (i,j)(i, j) in your coloring otherwise (in particular, in this case c_i,j=c_j,ic\_{i, j} = c\_{j, i}). Print c_i,jc\_{i, j} in 7n7n lines containing 7n7n numbers each.

It is guaranteed that a solution exists.

힌트

The second sample test corresponds to the following coloring:

Here are two separate subgraphs for both colors: