#include <bits/stdc++.h>
using namespace std;
vector<int> get_perm(vector<int> A) {
  int n = A.size();
  int mark[1 << 19] = {0};
  vector<int> res(n);
  for (int i = n - 1; i >= 0; i--) {
    int idx = (1 << 18) + A[i];
    while (idx > 1) {
      mark[idx]++;
      idx /= 2;
    }
    int now = A[i];
    idx = 1;
    for (int bit = 17; bit >= 0; bit--) {
      idx *= 2;
      if (now & (1 << bit)) {
        res[i] += mark[idx];
        idx++;
      }
    }
  }
  return res;
}
vector<int> revert_perm(vector<int> A) {
  int n = A.size();
  int mark[1 << 19] = {0};
  for (int i = n - 1; i >= 0; i--) {
    int idx = (1 << 18) + i;
    while (idx > 1) {
      mark[idx]++;
      idx /= 2;
    }
  }
  vector<int> res(n);
  for (int i = 0; i < n; i++) {
    int idx = 1;
    while (idx < (1 << 18)) {
      idx *= 2;
      if (mark[idx] <= A[i]) {
        A[i] -= mark[idx];
        idx++;
      }
    }
    res[i] = idx - (1 << 18);
    idx = (1 << 18) + res[i];
    while (idx > 1) {
      mark[idx]--;
      idx /= 2;
    }
  }
  return res;
}
int main() {
  int n;
  scanf("%d", &n);
  vector<int> A(n), B(n);
  for (int i = 0; i < n; i++) cin >> A[i];
  for (int i = 0; i < n; i++) cin >> B[i];
  vector<int> p1 = get_perm(A);
  vector<int> p2 = get_perm(B);
  for (int i = 0; i < n; i++) p1[i] += p2[i];
  for (int i = n - 2; i >= 0; i--)
    if (p1[i] >= n - i) {
      p1[i] -= (n - i);
      if (i) p1[i - 1]++;
    }
  vector<int> res = revert_perm(p1);
  for (int i = 0; i < n; i++) printf("%d ", res[i]);
  printf("\n");
}
