Let's define the sum of two permutations p and q of numbers 0, 1, ..., (n - 1) as permutation <image>, where Perm(x) is the x-th lexicographically permutation of numbers 0, 1, ..., (n - 1) (counting from zero), and Ord(p) is the number of permutation p in the lexicographical order.

For example, Perm(0) = (0, 1, ..., n - 2, n - 1), Perm(n! - 1) = (n - 1, n - 2, ..., 1, 0)

Misha has two permutations, p and q. Your task is to find their sum.

Permutation a = (a0, a1, ..., an - 1) is called to be lexicographically smaller than permutation b = (b0, b1, ..., bn - 1), if for some k following conditions hold: a0 = b0, a1 = b1, ..., ak - 1 = bk - 1, ak < bk.

Input

The first line contains an integer n (1 ≤ n ≤ 200 000).

The second line contains n distinct integers from 0 to n - 1, separated by a space, forming permutation p.

The third line contains n distinct integers from 0 to n - 1, separated by spaces, forming permutation q.

Output

Print n distinct integers from 0 to n - 1, forming the sum of the given permutations. Separate the numbers by spaces.

Examples

Input

2
0 1
0 1


Output

0 1


Input

2
0 1
1 0


Output

1 0


Input

3
1 2 0
2 1 0


Output

1 0 2

Note

Permutations of numbers from 0 to 1 in the lexicographical order: (0, 1), (1, 0).

In the first sample Ord(p) = 0 and Ord(q) = 0, so the answer is <image>.

In the second sample Ord(p) = 0 and Ord(q) = 1, so the answer is <image>.

Permutations of numbers from 0 to 2 in the lexicographical order: (0, 1, 2), (0, 2, 1), (1, 0, 2), (1, 2, 0), (2, 0, 1), (2, 1, 0).

In the third sample Ord(p) = 3 and Ord(q) = 5, so the answer is <image>.
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author sumit
 */
public class Main {
      public static void main(String[] args) {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            InputReader in = new InputReader(inputStream);
            OutputWriter out = new OutputWriter(outputStream);
            DMishaAndPermutationsSummation solver = new DMishaAndPermutationsSummation();
            solver.solve(1, in, out);
            out.close();
      }

      static class DMishaAndPermutationsSummation {
            int nn = 200001;
            int[] tree;

            void build() {
                  tree = new int[nn * 2];
                  for (int i = nn; i < 2 * nn; i++) {
                        tree[i] = 1;
                  }
                  for (int i = nn - 1; i > 0; i--) {
                        tree[i] = tree[2 * i] + tree[2 * i + 1];
                  }
            }

            void update(int index, int val) {
                  for (int i = index + nn; i > 0; i = i / 2) {
                        tree[i] += val;
                  }
            }

            int query(int l, int r) {
                  int ans = 0;
                  for (int i = l + nn, j = r + nn; i <= j; i = i / 2, j = j / 2) {
                        if (i % 2 == 1) {
                              ans = ans + tree[i];
                              i++;
                        }
                        if (j % 2 == 0) {
                              ans = ans + tree[j];
                              j--;
                        }
                  }
                  return ans;
            }

            int[] factoradical(int[] arr) {
                  int n = arr.length;
                  build();
                  int[] ans = new int[n];
                  for (int i = 0; i < n; i++) {
                        int sm = query(0, arr[i] - 1);
                        ans[i] = sm;
                        update(arr[i], -1);
                  }
                  return ans;
            }

            int[] sum(int[] arr1, int[] arr2) {
                  int n = arr1.length;
                  int rem = 0;
                  int req = 0;
                  int ans[] = new int[n];
                  for (int i = n - 1; i >= 0; i--) {
                        int sm = arr1[i] + arr2[i] + rem;
                        ans[i] = sm % (req + 1);
                        rem = sm / (req + 1);
                        req++;
                  }
                  return ans;
            }

            int search(int vv) {
                  int start = 0;
                  int end = nn - 1;
                  int ans = -1;
                  while (start <= end) {
                        int mid = (start + end) / 2;
                        int val = query(0, mid - 1);
                        if (val <= vv) {

                              ans = mid;
                              start = mid + 1;
                        } else {
                              end = mid - 1;
                        }
                  }
                  return ans;
            }

            int[] makePerm(int[] arr) {
                  build();
                  int n = arr.length;
                  int[] ans = new int[n];
                  for (int i = 0; i < n; i++) {

                        int vv = search(arr[i]);
                        ans[i] = vv;
                        update(vv, -1);
                  }
                  return ans;
            }

            public void solve(int testNumber, InputReader in, OutputWriter out) {
                  int n = in.nextInt();
                  int arr1[] = factoradical(in.nextIntArray(n));
                  int arr2[] = factoradical(in.nextIntArray(n));
//        System.out.println("arr1");
//        print(arr1);
//        System.out.println("arr2");
//        print(arr2);

                  int arr[] = sum(arr1, arr2);
//        System.out.println("arr");
//        print(arr);

                  arr = makePerm(arr);


                  for (int i = 0; i < n; i++) {
                        out.print(arr[i] + " ");
                  }
                  out.printLine();


            }

      }

      static class OutputWriter {
            private final PrintWriter writer;

            public OutputWriter(OutputStream outputStream) {
                  writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
            }

            public OutputWriter(Writer writer) {
                  this.writer = new PrintWriter(writer);
            }

            public void print(Object... objects) {
                  for (int i = 0; i < objects.length; i++) {
                        if (i != 0) {
                              writer.print(' ');
                        }
                        writer.print(objects[i]);
                  }
            }

            public void printLine() {
                  writer.println();
            }

            public void close() {
                  writer.close();
            }

      }

      static class InputReader {
            private InputStream stream;
            private byte[] buf = new byte[1024];
            private int curChar;
            private int numChars;

            public InputReader(InputStream stream) {
                  this.stream = stream;
            }

            public int read() {
                  if (numChars == -1)
                        throw new InputMismatchException();

                  if (curChar >= numChars) {
                        curChar = 0;
                        try {
                              numChars = stream.read(buf);
                        } catch (IOException e) {
                              throw new InputMismatchException();
                        }
                        if (numChars <= 0)
                              return -1;
                  }

                  return buf[curChar++];
            }

            public int nextInt() {
                  int c = read();

                  while (isSpaceChar(c))
                        c = read();

                  int sgn = 1;

                  if (c == '-') {
                        sgn = -1;
                        c = read();
                  }

                  int res = 0;

                  do {
                        if (c < '0' || c > '9')
                              throw new InputMismatchException();

                        res *= 10;
                        res += c & 15;

                        c = read();
                  } while (!isSpaceChar(c));

                  return res * sgn;
            }

            public int[] nextIntArray(int arraySize) {
                  int array[] = new int[arraySize];

                  for (int i = 0; i < arraySize; i++)
                        array[i] = nextInt();

                  return array;
            }

            public boolean isSpaceChar(int c) {
                  return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
            }

      }
}

