#include <bits/stdc++.h>
using namespace std;
int bit[200005];
void u(int i, int v) {
  i++;
  for (; i < 200005; i += i & -i) bit[i] += v;
}
int q(int i) {
  i++;
  int r = 0;
  for (; i > 0; i -= i & -i) r += bit[i];
  return r;
}
int n;
void X(int *a, int *b) {
  memset(bit, 0, sizeof bit);
  for (int i = (0); i < (n); i++) u(i, 1);
  for (int i = (0); i < (n); i++) {
    b[i] = q(a[i]) - 1;
    u(a[i], -1);
  }
}
void IX(int *a, int *b) {
  memset(bit, 0, sizeof bit);
  for (int i = (0); i < (n); i++) u(i, 1);
  for (int i = (0); i < (n); i++) {
    int s = 0, e = n - 1, best = -1;
    while (s <= e) {
      int md = (s + e) / 2;
      if (q(md) > a[i]) {
        best = md;
        e = md - 1;
      } else
        s = md + 1;
    }
    u(best, -1);
    b[i] = best;
  }
}
int a[200005], b[200005];
int aa[200005], bb[200005];
int rr[200005], r[200005];
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);
  X(a, aa);
  X(b, bb);
  int carry = 0;
  for (int i = n - 1; i >= 0; i--) {
    int l = aa[i] + bb[i] + carry;
    rr[i] = l % (n - i);
    carry = l / (n - i);
  }
  IX(rr, r);
  for (int i = (0); i < (n); i++) printf("%d%c", r[i], " \n"[i == n - 1]);
}
