QOJ.ac

QOJ

时间限制: 1 s 内存限制: 1024 MB 总分: 100 可 Hack ✓

#18590. ibasic Sequences

统计

For ibasic, who inherited the will of ian0704, let us find a sequence $A$ of length $3N$ that satisfies all of the following conditions:

  • $A$ is a permutation containing each integer from $1$ to $3N$ exactly once.
  • For all $l, r$ such that $1\le l< r\le 3N$, the median of $[A_l, A_{l+1}, \dots, A_r]$ is between $N+1$ and $2N$ inclusive. The median of a sequence of length $k$ is the $\frac{k+1}{2}$-th smallest number if $k$ is odd, and the average of the $\frac{k}{2}$-th smallest and $\frac{k}{2}+1$-th smallest numbers if $k$ is even.

Input

The first line contains an integer $N$.

Output

Output the sequence $A_1, A_2, \dots, A_{3N}$ satisfying the conditions, separated by spaces. If no such sequence exists, output -1 instead. If there are multiple possible sequences, any one of them is acceptable.

Examples

Input 1

2

Output 1

1 5 3 4 2 6

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.