#include <bits/stdc++.h>
using namespace std;
const int N = 200005, mod = 1e9 + 7;
int sum[N << 2];
inline void read(int &x) {
  char ch;
  int t = 0;
  x = 0;
  for (ch = getchar(); ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') t = 1;
  for (; ch >= '0' && ch <= '9'; x = x * 10 + ch - 48, ch = getchar())
    ;
  if (t) x = -x;
}
void pushup(int rt) { sum[rt] = sum[rt << 1] + sum[rt << 1 | 1]; }
void update(int p, int c, int l, int r, int rt) {
  if (l == r) {
    sum[rt] += c;
    return;
  }
  int m = (l + r) >> 1;
  if (p <= m)
    update(p, c, l, m, rt << 1);
  else
    update(p, c, m + 1, r, rt << 1 | 1);
  pushup(rt);
}
int query(int L, int R, int l, int r, int rt) {
  if (L <= l && r <= R) return sum[rt];
  int m = (l + r) >> 1, ret = 0;
  if (L <= m) ret += query(L, R, l, m, rt << 1);
  if (m < R) ret += query(L, R, m + 1, r, rt << 1 | 1);
  return ret;
}
void build(int l, int r, int rt) {
  if (l == r) {
    sum[rt] = 1;
    return;
  }
  int m = (l + r) >> 1;
  build(l, m, rt << 1);
  build(m + 1, r, rt << 1 | 1);
  pushup(rt);
}
int search(int p, int l, int r, int rt) {
  if (l == r) {
    sum[rt]--;
    return l;
  }
  int m = (l + r) >> 1, t;
  if (sum[rt << 1] >= p)
    t = search(p, l, m, rt << 1);
  else
    t = search(p - sum[rt << 1], m + 1, r, rt << 1 | 1);
  pushup(rt);
  return t;
}
int a[N], b[N], c[N], a1[N], b1[N], ans[N];
int main() {
  int T, n, m, i, j, k, x, y, s, t;
  scanf("%d", &n);
  for (i = 0; i < n; i++) read(a[i]);
  for (i = 0; i < n; i++) read(b[i]);
  memset(sum, 0, sizeof(sum));
  for (i = n - 1; i >= 0; i--) {
    a1[i] = query(0, a[i], 0, n - 1, 1);
    update(a[i], 1, 0, n - 1, 1);
  }
  memset(sum, 0, sizeof(sum));
  for (i = n - 1; i >= 0; i--) {
    b1[i] = query(0, b[i], 0, n - 1, 1);
    update(b[i], 1, 0, n - 1, 1);
  }
  for (t = 0, i = n - 2; i >= 0; i--) {
    k = n - i;
    c[i] = a1[i] + b1[i] + t;
    t = 0;
    if (c[i] >= k) t++, c[i] %= k;
  }
  build(0, n - 1, 1);
  for (i = 0; i < n; i++) {
    ans[i] = search(c[i] + 1, 0, n - 1, 1);
    printf("%d ", ans[i]);
  }
  return 0;
}
