QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 512 MB 總分: 100

#6652. Coloring

统计

Given an undirected complete graph with $n$ nodes, you need to assign a number from $0$ to $9$ to each edge such that there is no triangle or pentagon in the graph where all edges have the same number.

Input

The input consists of a single integer $n$, representing the number of nodes in the graph.

Output

If no such assignment exists, output a single integer $-1$. Otherwise, output $(n - 1)$ lines. The $i$-th line should contain $(n - i)$ characters, where the $j$-th character of the $i$-th line represents the label of the edge $(i, i + j)$. If there are multiple valid solutions, you may output any one of them.

Examples

Input 1

4

Output 1

012
34
5

Constraints

For all test cases, $2 \le n \le 1000$.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.