#include <bits/stdc++.h>
using namespace std;
int ft[200200];
int n, x;
void update(int idx, int v) {
  for (; idx <= n; idx += idx & -idx) ft[idx] += v;
}
int query(int idx) {
  int v = 0;
  while (idx) {
    v += ft[idx];
    idx -= (idx & -idx);
  }
  return v;
}
int p[202020], q[202020], r[202020];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) update(i, 1);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &x);
    p[i] = query(x);
    update(x + 1, -1);
  }
  for (int i = 1; i <= n; ++i) update(i, 1);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &x);
    q[i] = query(x);
    update(x + 1, -1);
  }
  for (int i = n - 1; i >= 0; --i) {
    r[i] += p[i] + q[i];
    if (r[i] > n - i - 1) {
      if (i > 0) r[i - 1] += r[i] / (n - i);
      r[i] %= n - i;
    }
  }
  for (int i = 1; i <= n; ++i) update(i, 1);
  for (int i = 0; i < n; ++i) {
    int lo = 1, hi = n, p;
    while (lo <= hi) {
      int mid = (lo + hi) >> 1;
      int q = query(mid - 1);
      if (q < r[i] || (q == r[i] && query(mid) - query(mid - 1) == 0)) {
        lo = mid + 1;
      } else {
        p = mid;
        hi = mid - 1;
      }
    }
    printf("%d ", p - 1);
    update(p, -1);
  }
  printf("\n");
  return 0;
}
