QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 2048 MB
[0]

# 9710. Loli, Yen-Jen, and a graph problem

Statistics

Yen-Jen loves loli very much!!!

Now, he is solving a problem with a cute, cat-eared loli. But he drinks too much yesterday and his mind is not open yet, so he asked you to solve the following problem for him!

There's a N vertice complete graph. Please decompose the graph into N1 trials, the ith trial must contain exactly i distinct edges. All edges must be decomposed in exactly one trial.

Input

The input contains only one line with one integer N, the number of vertices in the complete graph.

  • 2N1000

Output

If there's no way to decompose the graph, output -1 in a single line.

Otherwise, output N1 lines, the ith line is the description of the ith trial. In the ith line, output i+1 integers represents the ith trial. The neiboring integers in one line represents the edges!

Please, do not output trailing spaces in every line!

Sample Input

3

Sample Output

1 2
2 3 1