Third Permutation
- Time limit
- 1.0 s
- Memory limit
- 256 MB
- Points
- 10partial
- AC rate
- 60.0%
- Solvers
- 2
You are given two permutations and
such that
in every position.
Create
third permutation
such that
and
in every position.
Input
The first line has an integer
: the permutation size.
The second line has
integers
.
The third line has
integers
.
Output
Print integers
. You can print any valid solution. If there are no solutions, print IMPOSSIBLE.
Constraints
Example
Input:
5
1 3 2 5 4
4 1 3 2 5Output:
3 2 5 4 1
Comments