CSES - HIIT Open 2024 - Dominoes
  • Time limit: 1.00 s
  • Memory limit: 512 MB

You are playing with dominoes. Each domino tile can be represented as a pair of two distinct numbers between 11 and 66. You want to build a long chain of domino tiles without rotating them such that all adjacent numbers are distinct. Can you put all domino tiles into this chain?

Input

The first line of the input contains the integer nn, the number of domino tiles.

The following nn lines contain two distinct integers between 11 and 66, describing each domino tile.

Output

If a solution exists, output 2n2n numbers on a single line describing the sequence of numbers in the chain.

Otherwise, output "Impossible".

Constraints

  • 1n1051 \le n \le 10^5

Example

Input:

3
1 2
1 2
2 3

Output:

2 3 1 2 1 2