#include <bits/stdc++.h>
int n, i, a[210001], b[210001], c[210001], p[210001];
inline int get() {
  char c;
  while (!isdigit(c = getchar()))
    ;
  int v = c - 48;
  while (isdigit(c = getchar())) v = v * 10 + c - 48;
  return v;
}
inline void add(int t) {
  for (t++; t <= n; t += t - (t & (t - 1))) ++p[t];
}
inline int ask(int t) {
  int ts = 0;
  for (t++; t; t = t & (t - 1)) ts += p[t];
  return ts;
}
inline void trans(int* x) {
  memset(p, 0, sizeof(p));
  int t = 0;
  for (i = 0; i < n; i++) {
    t = x[i];
    x[i] -= ask(x[i]);
    add(t);
  }
}
inline void retrs(int* x) {
  memset(p, 0, sizeof(p));
  int t = 0;
  for (i = 0; i < n; i++) {
    int l = 0, r = n - 1, m;
    while (l < r) {
      m = (l + r) / 2;
      if (ask(m) + x[i] <= m)
        r = m;
      else
        l = m + 1;
    }
    add(x[i] = l);
  }
}
int main() {
  n = get();
  for (i = 0; i < n; i++) a[i] = get();
  trans(a);
  for (i = 0; i < n; i++) b[i] = get();
  trans(b);
  for (i = n - 1; i >= 0; --i) {
    c[i] += a[i] + b[i];
    while (c[i] >= n - i) {
      c[i] -= n - i;
      if (i) ++c[i - 1];
    }
  }
  retrs(c);
  for (i = 0; i < n; i++) printf("%d ", c[i]);
  puts("");
  return 0;
}
