#include <bits/stdc++.h>
using namespace std;
using namespace std;
const int N = 200010;
int sum[N << 2], n;
int seqa[N], seqb[N], seq[N], ans[N];
void pushup(int rt) { sum[rt] = sum[rt << 1] + sum[rt << 1 | 1]; }
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);
}
void update(int p, int val, int l, int r, int rt) {
  if (l == r) {
    sum[rt] = val;
    return;
  }
  int m = (l + r) >> 1;
  if (p > m)
    update(p, val, m + 1, r, rt << 1 | 1);
  else
    update(p, val, l, m, rt << 1);
  pushup(rt);
}
int query(int s, int e, int l, int r, int rt) {
  if (s <= l && e >= r) return sum[rt];
  int m = (l + r) >> 1, ret = 0;
  if (s <= m) ret += query(s, e, l, m, rt << 1);
  if (e > m) ret += query(s, e, m + 1, r, rt << 1 | 1);
  return ret;
}
int bs(int x) {
  int l = 1, r = n, ret = -1;
  while (l <= r) {
    int m = (l + r) >> 1;
    if (query(1, m, 1, n, 1) > x) {
      ret = m;
      r = m - 1;
    } else
      l = m + 1;
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  build(1, n, 1);
  for (int i = 1; i <= n; ++i) {
    int x;
    scanf("%d", &x);
    if (x)
      seqa[i] = query(1, x, 1, n, 1);
    else
      seqa[i] = 0;
    update(x + 1, 0, 1, n, 1);
  }
  build(1, n, 1);
  for (int i = 1; i <= n; ++i) {
    int x;
    scanf("%d", &x);
    if (x)
      seqb[i] = query(1, x, 1, n, 1);
    else
      seqb[i] = 0;
    update(x + 1, 0, 1, n, 1);
  }
  for (int i = n; i >= 1; --i) {
    seq[i] += seqa[i] + seqb[i];
    if (seq[i] >= n - i + 1) {
      seq[i] -= n - i + 1;
      seq[i - 1]++;
    }
  }
  build(1, n, 1);
  for (int i = 1; i <= n; ++i) {
    int pos = bs(seq[i]);
    ans[i] = pos - 1;
    update(pos, 0, 1, n, 1);
  }
  for (int i = 1; i <= n; ++i) printf("%d ", ans[i]);
  return 0;
}
