#include <bits/stdc++.h>
using namespace std;
const int maxn = 200020;
const int logn = 18;
const int MOd = 1e9 + 7;
int ar[maxn], bs[maxn], fw[maxn], fw2[maxn], a;
int yu[maxn], n, segment[maxn * 3], f[maxn];
int main() {
  scanf("%d", &a);
  for (int i = 1; i <= a; i++) scanf("%d", &ar[i]), ar[i]++;
  for (int i = 1; i <= a; i++) scanf("%d", &bs[i]), bs[i]++;
  for (int i = a; i >= 1; i--) {
    int p = 0, q = 0;
    for (int j = ar[i]; j > 0; j -= j & (-j)) p += fw[j];
    for (int j = bs[i]; j > 0; j -= j & (-j)) q += fw2[j];
    yu[i] += q + p;
    if (yu[i] > a - i) yu[i - 1]++, yu[i] -= a - i + 1;
    for (int j = ar[i]; j <= a; j += j & (-j)) fw[j]++;
    for (int j = bs[i]; j <= a; j += j & (-j)) fw2[j]++;
  }
  for (int i = 1; i <= a; i++)
    for (int j = i; j <= a; j += j & (-j)) f[j]++;
  for (int i = 1; i <= a; i++) {
    int ans = 0;
    int t = 0;
    for (int k = 18; k >= 0; k--) {
      if (t + (1 << k) > a) continue;
      int p = 0;
      for (int j = t + (1 << k); j > 0; j -= j & (-j)) p += f[j];
      if (p <= yu[i]) t += (1 << k);
    }
    printf("%d ", t);
    for (int j = t + 1; j <= a; j += j & (-j)) f[j]--;
  }
  printf("\n");
  return 0;
}
