#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 500;
int a[N], b[N], c[N], ans[N];
int bit[N];
int n;
struct tree {
  int data;
  int l, r;
} t[N * 4];
void add(int x) {
  while (x <= n) {
    bit[x]++;
    x += x & -x;
  }
  return;
}
int ask(int x) {
  int ans = 0;
  while (x) {
    ans += bit[x];
    x -= x & -x;
  }
  return ans;
}
void pushup(int p) {
  t[p].data = t[p * 2].data + t[p * 2 + 1].data;
  return;
}
void build(int p, int l, int r) {
  t[p].data = 0;
  t[p].l = l;
  t[p].r = r;
  if (l == r) return;
  int mid = (l + r) / 2;
  build(p * 2, l, mid);
  build(p * 2 + 1, mid + 1, r);
}
void change(int p, int x) {
  if (t[p].l == t[p].r) {
    t[p].data = 1;
    return;
  }
  int mid = (t[p].l + t[p].r) / 2;
  if (x <= mid)
    change(p * 2, x);
  else
    change(p * 2 + 1, x);
  pushup(p);
}
int Ask(int p, int x) {
  if (t[p].l == t[p].r) {
    return t[p].l;
  }
  int mid = (t[p].l + t[p].r) / 2;
  if (mid - t[p].l + 1 - t[p * 2].data > x)
    Ask(p * 2, x);
  else
    Ask(p * 2 + 1, x - (mid - t[p].l + 1 - t[p * 2].data));
}
int main() {
  scanf("%d", &n);
  int x;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &x);
    x++;
    a[i] = x - 1 - ask(x);
    add(x);
  }
  memset(bit, 0, sizeof(bit));
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &x);
    x++;
    b[i] = x - 1 - ask(x);
    add(x);
  }
  int yu = 0;
  for (int i = n; i >= 1; --i) {
    c[i] = (a[i] + b[i] + yu) % (n + 1 - i);
    yu = (a[i] + b[i] + yu) / (n + 1 - i);
  }
  build(1, 1, n);
  for (int i = 1; i <= n; ++i) {
    ans[i] = Ask(1, c[i]);
    change(1, ans[i]);
  }
  for (int i = 1; i <= n; ++i) {
    printf("%d ", ans[i] - 1);
  }
  return 0;
}
