#include <bits/stdc++.h>
int n, p, ar[200005], v[200005];
int sum(int a) {
  int ret = 0;
  while (a > 0) {
    ret += ar[a];
    a -= (a & -a);
  }
  return ret;
}
void upd(int a, int v) {
  while (a <= n) {
    ar[a] += v;
    a += (a & -a);
  }
}
int find(int a) {
  int ret = 0, cs = 0;
  for (int i = 1 << 18; i > 0; i >>= 1) {
    ret += i;
    if (ret >= n || cs + ar[ret] >= a)
      ret -= i;
    else
      cs += ar[ret];
  }
  return ret + 1;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &p);
    upd(p + 1, 1);
    v[i] += p - sum(p);
  }
  memset(ar, 0, sizeof ar);
  for (int i = 0; i < n; i++) {
    scanf("%d", &p);
    upd(p + 1, 1);
    v[i] += p - sum(p);
  }
  for (int i = n - 1; i > 0; i--) {
    if (v[i] >= n - i) {
      v[i - 1]++;
      v[i] -= n - i;
    }
  }
  for (int i = 0; i < n; i++) {
    if (i == 0 && v[i] >= n) v[i] -= n;
    int ans = find(v[i] + 1);
    printf("%d ", ans - 1);
    upd(ans, -1);
  }
  return 0;
}
