#include <bits/stdc++.h>
using namespace std;
const int maxn = 200100;
int a[maxn], b[maxn], aa[maxn], bb[maxn], cc[maxn];
int t[maxn];
int n;
void upd(int x) {
  x++;
  while (x <= n) {
    t[x]++;
    x += (x & (-x));
  }
}
void upd2(int x, int y) {
  while (x <= n) {
    t[x] += y;
    x += (x & (-x));
  }
}
int get2(int x) {
  int res = 0;
  while (x > 0) {
    res += t[x];
    x -= (x & (-x));
  }
  return res;
}
int get(int x) {
  x--;
  int res = 0;
  while (x > 0) {
    res += t[x];
    x -= (x & (-x));
  }
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) {
    scanf("%d", &b[i]);
  }
  for (int i = n - 1; i >= 0; i--) {
    aa[i] = get2(a[i] + 1);
    upd2(a[i] + 1, 1);
  }
  memset(t, 0, sizeof(t));
  int mem = 0;
  for (int i = n - 1; i >= 0; i--) {
    bb[i] = get2(b[i] + 1);
    upd2(b[i] + 1, 1);
    cc[i] = aa[i] + bb[i] + mem;
    if (cc[i] > n - 1 - i) {
      mem = 1;
      cc[i] -= n - i;
    } else
      mem = 0;
  }
  memset(t, 0, sizeof(t));
  for (int i = 1; i <= n; i++) upd2(i, 1);
  for (int i = 0; i < n; i++) {
    cc[i]++;
    int fir = 0;
    int las = n + 1;
    while (fir + 1 < las) {
      int mid = (fir + las) >> 1;
      if (get2(mid) >= cc[i])
        las = mid;
      else
        fir = mid;
    }
    upd2(las, -1);
    printf("%d ", las - 1);
  }
}
