3rd Balkan Olympiad in Informatics
Varna, Bulgaria, 5-11 October 1995


Day 2 - Problem 2 (Baseball League)



One of the tasks of the Ministry of Sports of a Balkan country is to organize a baseball championship of n teams (numbered form 1 to n). The championship must consist of no more than n rounds and each two teams must play against each other exactly once. Write a program that produces a schedule for the championship.

Input:
The number of teams n (1<=n<=24) will be entered from the console.

Output:
The output is a table of integers with n rows. The j-th integer in the i-th row is the number of the team which plays against team i in the j-th round. If team i is idle in the j-th round then this number is 0.

Sample input:
3 4
Samples output:
2 3 0 2 3 4
1 0 3 1 4 3
0 1 2 4 1 2

3 2 1