#include <bits/stdc++.h>
using namespace std;
int num1[201000], num2[201000], c[201000], n;
void opr(int val, int p) {
  for (; val <= n; val += (val & -val)) c[val] += p;
  return;
}
int que(int val) {
  int r = 0;
  for (; val >= 1; val -= (val & -val)) r += c[val];
  return r;
}
int get(int k) {
  int ans = 0, now = 0;
  for (int i = 20; i >= 0; i--)
    if (ans + (1 << i) > n || now + c[ans + (1 << i)] >= k)
      continue;
    else {
      now += c[ans + (1 << i)];
      ans += (1 << i);
    }
  return ans + 1;
}
int pe[201000], q;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &num1[i]);
    num1[i]++;
    opr(num1[i], 1);
  }
  for (int i = 1; i <= n; i++) {
    q = que(num1[i]) - 1;
    opr(num1[i], -1);
    pe[n - i] += q;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &num2[i]);
    num2[i]++;
    opr(num2[i], 1);
  }
  for (int i = 1; i <= n; i++) {
    q = que(num2[i]) - 1;
    opr(num2[i], -1);
    pe[n - i] += q;
  }
  int o = 1;
  for (; o < n; o++) {
    if (o == n - 1) {
      pe[o] = pe[o] % (o + 1);
      continue;
    }
    if (pe[o] > o) pe[o + 1] += pe[o] / (o + 1), pe[o] = pe[o] % (o + 1);
  }
  memset(c, 0, sizeof(c));
  for (int i = 1; i <= n; i++) opr(i, 1);
  for (int i = n - 1; i >= 0; i--) {
    int ls = get(pe[i] + 1);
    printf("%d ", ls - 1);
    opr(ls, -1);
  }
  return 0;
}
