#P375. 【例65.1】 循环比赛

【例65.1】 循环比赛

Description

Suppose there are NN players in a round-robin tournament, where N=2MN=2^M. Each player must play against every other player exactly once. Each player plays one match per day, and the round-robin tournament lasts for N1N-1 days. No player has a bye on any day.

Input Format

Input: MM

Output Format

Output: The match schedule in table form. Each row's data is separated by a space.

Sample

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