#include <bits/stdc++.h>
int permo[1000050], permt[1000050], permon[1000050], permtw[1000050],
    perm[1000050], tree[1000050];
int v, ql, qr, ans, x, num;
void query(int o, int l, int r) {
  if (ql <= l && r <= qr) {
    ans += tree[o];
    return;
  }
  int mid = (l + r) >> 1;
  if (ql <= mid) query(o * 2, l, mid);
  if (qr > mid) query(o * 2 + 1, mid + 1, r);
}
void update(int o, int l, int r) {
  if (l == r) {
    tree[o] = v;
    return;
  }
  int mid = (l + r) >> 1;
  if (x <= mid)
    update(o * 2, l, mid);
  else
    update(o * 2 + 1, mid + 1, r);
  tree[o] = tree[o * 2] + tree[o * 2 + 1];
}
void query2(int o, int l, int r) {
  if (l == r) {
    printf("%d ", l - 1);
    tree[o] = 0;
    return;
  }
  if (tree[o * 2] < x) {
    x -= tree[o * 2];
    query2(o * 2 + 1, ((l + r) >> 1) + 1, r);
  } else
    query2(o * 2, l, (l + r) >> 1);
  tree[o] = tree[o * 2] + tree[o * 2 + 1];
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &num);
    permo[i] = num + 1;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &num);
    permt[i] = num + 1;
  }
  memset(tree, 0, sizeof(tree));
  for (int i = 1; i <= n; i++) {
    x = i;
    v = 1;
    update(1, 1, n);
  }
  for (int i = 1; i <= n; i++) {
    ql = 1;
    qr = permo[i] - 1;
    ans = 0;
    if (ql <= qr) query(1, 1, n);
    permon[i] = ans;
    x = permo[i];
    v = 0;
    update(1, 1, n);
  }
  memset(tree, 0, sizeof(tree));
  for (int i = 1; i <= n; i++) {
    x = i;
    v = 1;
    update(1, 1, n);
  }
  for (int i = 1; i <= n; i++) {
    ql = 1;
    qr = permt[i] - 1;
    ans = 0;
    if (ql <= qr) query(1, 1, n);
    permtw[i] = ans;
    x = permt[i];
    v = 0;
    update(1, 1, n);
  }
  memset(tree, 0, sizeof(tree));
  for (int i = 1; i <= n; i++) {
    x = i;
    v = 1;
    update(1, 1, n);
  }
  int k;
  for (int i = n, k = 0; i >= 1; i--, k++) {
    perm[i] += permon[i] + permtw[i];
    if (perm[i] >= (k + 1)) {
      perm[i] -= k + 1;
      perm[i - 1] += 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    x = perm[i] + 1;
    query2(1, 1, n);
  }
  return 0;
}
