#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int n, l, r, m, a[N], t[N], p[N];
void clr() {
  for (int i = 1; i <= n; i++) t[i] = 0;
}
void upd(int i, int x) {
  for (; i <= n; i += i & -i) t[i] += x;
}
int get(int i) {
  int s = 0;
  for (; i; i -= i & -i) s += t[i];
  return s;
}
int main() {
  scanf("%d", &n);
  for (int g = 0; g < 2; g++) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    clr();
    for (int i = n; i; i--) p[i] += get(a[i]), upd(a[i] + 1, 1);
  }
  for (int i = n; i > 1; i--)
    if (p[i] > n - i) p[i - 1]++, p[i] -= n - i + 1;
  if (p[1] >= n) p[1] -= n;
  clr();
  for (int i = 1; i <= n; i++) upd(i, 1);
  for (int i = 1; i <= n; i++) {
    l = 0;
    r = n + 1;
    while (l + 1 < r) {
      m = l + r >> 1;
      if (get(m) > p[i])
        r = m;
      else
        l = m;
    }
    printf("%d ", r - 1);
    upd(r, -1);
  }
  return 0;
}
