#agc007b. [agc007_b]Construct Sequences
[agc007_b]Construct Sequences
Problem Statement
#nck { width: 30px; height: auto; }
You are given a permutation of the set {}. Please construct two sequences of positive integers , , ..., and , , ..., satisfying the following conditions:
- for all
- $a_{p_1}+b_{p_1} < a_{p_2}+b_{p_2} < ... < a_{p_N}+b_{p_N}$
Constraints
- is a permutation of the set {}
Input
The input is given from Standard Input in the following format:
Output
The output consists of two lines. The first line contains , , ..., seperated by a space. The second line contains , , ..., seperated by a space.
It can be shown that there always exists a solution for any input satisfying the constraints.
Sample Input 1
2
1 2
Sample Output 1
1 4
5 4
and . So this output satisfies all conditions.
Sample Input 2
3
3 2 1
Sample Output 2
1 2 3
5 3 1
Sample Input 3
3
2 3 1
Sample Output 3
5 10 100
100 10 1