#include <bits/stdc++.h>
using namespace std;
int a[300000], b[300000];
int bita[300000];
int bitb[300000];
int bitc[300000];
int n;
void inc(int a[], int x) {
  for (; x <= n; x += x & -x) a[x]++;
}
void dec(int a[], int x) {
  for (; x <= n; x += x & -x) a[x]--;
}
int getSum(int a[], int x) {
  int re = 0;
  for (; x > 0; x -= x & -x) {
    re += a[x];
  }
  return re;
}
int cntA[300000];
int cntB[300000];
int cntC[300000];
int result[300000];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) cin >> b[i];
  for (int i = 0; i < n; ++i) {
    cntA[i] = a[i] - getSum(bita, a[i]);
    inc(bita, a[i] + 1);
  }
  for (int i = 0; i < n; ++i) {
    cntB[i] = b[i] - getSum(bitb, b[i]);
    inc(bitb, b[i] + 1);
  }
  int re = 0;
  for (int i = n - 2; i >= 0; --i) {
    cntC[i] = (cntA[i] + cntB[i] + re) % (n - i);
    re = (cntA[i] + cntB[i] + re) / (n - i);
  }
  cntC[n - 1] = 0;
  for (int i = 0; i < n; ++i) {
    inc(bitc, i + 1);
  }
  for (int i = 0; i < n; ++i) {
    int be = 1;
    int en = n;
    cntC[i]++;
    while (be < en) {
      int me = (be + en) / 2;
      int cntl = getSum(bitc, me);
      if (cntl >= cntC[i]) {
        en = me;
      } else {
        be = me + 1;
      }
    }
    result[i] = be - 1;
    dec(bitc, be);
  }
  for (int i = 0; i < n; ++i) cout << result[i] << " ";
  return 0;
}
