Score : 400 points
You are given a permutation p of the set {1, 2, ..., N}. Please construct two sequences of positive integers a_1, a_2, ..., a_N and b_1, b_2, ..., b_N satisfying the following conditions:
The input is given from Standard Input in the following format:
N p_1 p_2 ... p_N
The output consists of two lines. The first line contains a_1, a_2, ..., a_N seperated by a space. The second line contains b_1, b_2, ..., b_N seperated by a space.
It can be shown that there always exists a solution for any input satisfying the constraints.
2 1 2
1 4 5 4
a_1 + b_1 = 6 and a_2 + b_2 = 8. So this output satisfies all conditions.
3 3 2 1
1 2 3 5 3 1
3 2 3 1
5 10 100 100 10 1