#include <bits/stdc++.h>
using namespace std;
const int kN = 2e5 + 1;
int ct[kN], bit[kN];
int n;
void Update(int x) {
  ++x;
  while (x <= n) {
    bit[x]++;
    x += x & -x;
  }
}
int Query(int x) {
  int c = 0;
  while (x) {
    c += bit[x];
    x -= x & -x;
  }
  return c;
}
void ReadProcess() {
  int x;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    ct[i] += x - Query(x);
    Update(x);
  }
}
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(false);
  cin >> n;
  ReadProcess();
  memset(bit, 0, sizeof bit);
  ReadProcess();
  for (int i = n - 1; i >= 0; --i) {
    if (ct[i] >= (n - i)) {
      ct[i] %= (n - i);
      if (i > 0) {
        ct[i - 1]++;
      }
    }
  }
  memset(bit, 0, sizeof bit);
  for (int i = 0; i < n; ++i) {
    int si = 0, ei = n;
    while (si + 1 < ei) {
      int mi = si + ((ei - si) >> 1);
      int diff = mi - Query(mi);
      if (diff <= ct[i]) {
        si = mi;
      } else {
        ei = mi;
      }
    }
    cout << si << " ";
    Update(si);
  }
  cout << endl;
  return 0;
}
