#include <bits/stdc++.h>
using namespace std;
int n;
int ar1[256010];
int ar2[256010];
int top[256010];
int KD[256010 * 4];
void update(int k, int a, int b, int t) {
  if (t < a || t > b) return;
  KD[k]--;
  if (a == b) return;
  update(k * 2, a, (a + b) / 2, t);
  update(k * 2 + 1, (a + b) / 2 + 1, b, t);
}
int ffind(int k, int a, int b, int a1, int b1) {
  if (b1 < a) return 0;
  if (b1 >= b) return KD[k];
  return ffind(k * 2, a, (a + b) / 2, a1, b1) +
         ffind(k * 2 + 1, (a + b) / 2 + 1, b, a1, b1);
}
void generate(int k, int a, int b) {
  KD[k] = b - a + 1;
  if (a == b) return;
  generate(k * 2, a, (a + b) / 2);
  generate(k * 2 + 1, (a + b) / 2 + 1, b);
}
int main() {
  int i;
  scanf(" %d", &n);
  generate(1, 0, n - 1);
  for (i = 0; i < n; i++) {
    scanf(" %d", &ar1[i]);
    top[i] += ffind(1, 0, n - 1, 0, ar1[i]) - 1;
    update(1, 0, n - 1, ar1[i]);
  }
  generate(1, 0, n - 1);
  for (i = 0; i < n; i++) {
    scanf(" %d", &ar2[i]);
    top[i] += ffind(1, 0, n - 1, 0, ar2[i]) - 1;
    update(1, 0, n - 1, ar2[i]);
  }
  int elde = 0;
  for (i = n - 1; i >= 0; i--) {
    int t = n - 1 - i;
    top[i] += elde;
    elde = 0;
    if (top[i] > t) {
      top[i] -= t + 1;
      elde = 1;
    }
  }
  generate(1, 0, n - 1);
  for (i = 0; i < n; i++) {
    int bas = 0, son = n - 1;
    while (bas < son) {
      int k = (bas + son) / 2;
      int r = ffind(1, 0, n - 1, 0, k) - 1;
      if (r >= top[i]) son = k;
      if (r < top[i]) bas = k + 1;
    }
    printf("%d ", bas);
    update(1, 0, n - 1, bas);
  }
  printf("\n");
  return 0;
}
