#T350. 循环比赛日程表

循环比赛日程表

Description

There are NN players participating in a round-robin tournament, where N=2MN = 2^M. Each player must compete against all other N1N-1 players exactly once. Each player competes once per day, and the tournament lasts for N1N-1 days, with no player being idle on any day.

Input Format

Input: MM.

Output Format

Output: A tabular schedule of the matches. Separate each data entry in a row with a single space.

3

1 2 3 4 5 6 7 8
2 1 4 3 6 5 8 7
3 4 1 2 7 8 5 6
4 3 2 1 8 7 6 5
5 6 7 8 1 2 3 4
6 5 8 7 2 1 4 3
7 8 5 6 3 4 1 2
8 7 6 5 4 3 2 1