#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
int n, a[maxn], b[maxn], c[maxn], d[maxn], f[maxn], g[maxn];
inline int lowbit(int x) { return x & (-x); }
void change(int x) {
  while (x <= n) {
    c[x]++;
    x += lowbit(x);
  }
}
int query(int x) {
  int s = 0;
  while (x) {
    s += c[x];
    x -= lowbit(x);
  }
  return s;
}
int query2(int x) {
  int now = 0, k = 131072;
  while (k) {
    if (now + k < n && x >= (k - c[now + k])) {
      now += k;
      x -= (k - c[now]);
    }
    k >>= 1;
  }
  return now + 1;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    a[i]++;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &b[i]);
    b[i]++;
  }
  memset(c, 0, sizeof(c));
  for (int i = n; i; i--) {
    f[i] = query(a[i]);
    change(a[i]);
  }
  memset(c, 0, sizeof(c));
  for (int i = n; i; i--) {
    g[i] = query(b[i]);
    change(b[i]);
  }
  int delta = 0;
  for (int i = n; i; i--) {
    f[i] = f[i] + g[i] + delta;
    if (f[i] > n - i) {
      f[i] -= (n - i + 1);
      delta = 1;
    } else
      delta = 0;
  }
  memset(c, 0, sizeof(c));
  for (int i = 1; i <= n; i++) {
    d[i] = query2(f[i]);
    change(d[i]);
    d[i]--;
  }
  for (int i = 1; i < n; i++) printf("%d ", d[i]);
  printf("%d\n", d[n]);
  return 0;
}
