#abc306c. [abc306_c]Centers
[abc306_c]Centers
Problem Statement
You are given a sequence of length where each of , and occurs exactly three times.
For , let be the index of the middle occurrence of in . Sort in ascending order of .
Formally, is defined as follows.
- Suppose that those such that are $j=\\alpha,\\beta,\\gamma\\ (\\alpha < \\beta < \\gamma)$. Then, .
Constraints
- occurs in exactly three times, for each .
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the sequence of length obtained by sorting in ascending order of , separated by spaces.
Sample Input 1
3
1 1 3 2 3 2 2 3 1
Sample Output 1
1 3 2
- occurs in at , so .
- occurs in at , so .
- occurs in at , so .
Thus, , so , and should be printed in this order.
Sample Input 2
1
1 1 1
Sample Output 2
1
Sample Input 3
4
2 3 4 3 4 1 3 1 1 4 2 2
Sample Output 3
3 4 1 2