#include <bits/stdc++.h>
using namespace std;
int n, a[200005], b[200005], aib[200005], orda[200005], ordb[200005],
    ord[200005];
int st, dr, mid;
bool uz[200005];
int query(int pos) {
  if (pos == 0) return 0;
  int S = 0;
  while (pos) {
    S += aib[pos];
    pos -= pos & (-pos);
  }
  return S;
}
void update(int pos) {
  while (pos <= n) {
    aib[pos]--;
    pos += (pos & (-pos));
  }
}
int main() {
  int i;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    a[i]++;
  }
  for (i = 1; i <= n; i++) {
    cin >> b[i];
    b[i]++;
  }
  for (i = 1; i <= n; i++) aib[i] = i & (-i);
  for (i = 1; i <= n; i++) {
    orda[n - i] = query(a[i] - 1);
    update(a[i]);
  }
  for (i = 1; i <= n; i++) aib[i] = i & (-i);
  for (i = 1; i <= n; i++) {
    ordb[n - i] = query(b[i] - 1);
    update(b[i]);
  }
  for (i = 0; i < n; i++) {
    ord[i] += orda[i] + ordb[i];
    if (ord[i] > i) {
      ord[i] -= i + 1;
      ord[i + 1]++;
    }
  }
  for (i = 1; i <= n; i++) aib[i] = i & (-i);
  for (i = n - 1; i >= 0; i--) {
    st = 1;
    dr = n;
    while (st < dr) {
      mid = (st + dr) >> 1;
      if (query(mid - 1) <= ord[i])
        st = mid + 1;
      else
        dr = mid - 1;
    }
    while (st > 0 && query(st - 1) > ord[i]) st--;
    cout << st - 1 << ' ';
    update(st);
  }
  return 0;
}
