#include <bits/stdc++.h>
using namespace std;
int n, i, x, sz[400010], b[200010], a[200010], c[200010], j, cf, t, ss;
int main() {
  scanf("%d", &n);
  for (cf = 1; cf < n; cf <<= 1, t++)
    ;
  for (i = 1; i <= n; i++) {
    scanf("%d", &x);
    a[i] = x;
    for (j = x + 1; j; j -= j & (-j)) a[i] -= sz[j];
    for (j = x + 1; j <= n; j += j & (-j)) sz[j]++;
  }
  memset(sz, 0, sizeof(sz));
  for (i = 1; i <= n; i++) {
    scanf("%d", &x);
    b[i] = x;
    for (j = x + 1; j; j -= j & (-j)) b[i] -= sz[j];
    for (j = x + 1; j <= n; j += j & (-j)) sz[j]++;
  }
  for (i = 1; i <= n; i++) sz[i] = i & (-i);
  for (i = n; i >= 1; i--) {
    c[i] += b[i] + a[i];
    c[i - 1] = c[i] / (n - i + 1);
    c[i] %= n - i + 1;
  }
  for (i = 1; i <= n; i++) {
    ss = 0;
    for (j = t; j >= 0; j--)
      if (sz[ss + (1 << j)] <= c[i] && (ss + (1 << j)) <= n)
        ss += 1 << j, c[i] -= sz[ss];
    printf("%d ", ss);
    for (j = ss + 1; j <= n; j += j & (-j)) sz[j]--;
  }
}
