#include <bits/stdc++.h>
using namespace std;
int f[200005], v[200005], n;
void upd(int first, int v) {
  while (first < 200005) f[first] += v, first += first & -first;
}
int query(int first) {
  int ans = 0;
  while (first) ans += f[first], first -= first & -first;
  return ans;
}
int t[200005 << 2];
void build(int p, int l, int r) {
  t[p] = r - l + 1;
  if (l == r) return;
  int m = (l + r) >> 1;
  build(p << 1, l, m);
  build(p << 1 | 1, m + 1, r);
}
void upd(int p, int l, int r, int first) {
  t[p]--;
  if (l == r) return;
  int m = (l + r) >> 1;
  if (first <= m)
    upd(p << 1, l, m, first);
  else
    upd(p << 1 | 1, m + 1, r, first);
}
int query(int p, int l, int r, int k) {
  if (l == r) return l;
  int m = (l + r) >> 1;
  if (t[p << 1] >= k) return query(p << 1, l, m, k);
  return query(p << 1 | 1, m + 1, r, k - t[p << 1]);
}
int main() {
  int T, i, j, k, m;
  while (~scanf("%d", &n)) {
    memset(f, 0, sizeof(f));
    for (i = 0; i < n; i++) {
      scanf("%d", &k);
      k++;
      j = k - 1 - query(k - 1);
      v[n - 1 - i] = j;
      upd(k, 1);
    }
    memset(f, 0, sizeof(f));
    for (i = 0; i < n; i++) {
      scanf("%d", &k);
      k++;
      j = k - 1 - query(k - 1);
      v[n - 1 - i] += j;
      upd(k, 1);
    }
    for (i = 0; i < n; i++) {
      if (v[i] > i) v[i + 1]++, v[i] -= i + 1;
    }
    build(1, 0, n - 1);
    for (i = n - 1; i >= 0; i--) {
      j = v[i];
      k = query(1, 0, n - 1, j + 1);
      upd(1, 0, n - 1, k);
      printf("%d ", k);
    }
    puts("");
  }
}
