시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 4 3 3 75.000%

문제

You are given a positive integer n and two arrays a and b containing n integers each.

You need to find permutation p of length n such that for each i ∈ {1, 2, . . . , n} the following two conditions are satisfied:

  • the length of longest increasing subsequence of p ending at position i is equal to ai,
  • the length of longest decreasing subsequence of p starting at position i is equal to bi.

입력

The first line of input contains a positive integer n (1 ≤ n ≤ 2 · 105), the length of the permutation.

The second line contains n integers a1, a2 . . . , an, where ai (1 ≤ ai ≤ n): the length of longest increasing subsequence ending at position i.

The third line contains n integers b1, b2 . . . , bn, where bi (1 ≤ bi ≤ n): the length of longest decreasing subsequence starting at position i.

출력

Print a line containing n space-separated integers p1, p2, . . . , pn: the desired permutation.

It is guaranteed that the answer exists. If there are multiple solutions, you may print any one of them.

예제 입력 1

5
1 1 1 2 3
3 2 1 1 1

예제 출력 1

3 2 1 4 5

예제 입력 2

6
1 1 2 2 3 3
2 1 2 1 2 1

예제 출력 2

2 1 4 3 6 5