#include <bits/stdc++.h>
using namespace std;
int bit[200010];
int a[200010], b[200010];
int pa[200010], pb[200010];
int pc[200010], c[200010];
int n;
int cal(int x) {
  int ret = 0;
  while (x > 0) {
    ret += bit[x];
    x -= x & (-x);
  }
  return ret;
}
void update(int x, int d) {
  while (x <= n) {
    bit[x] += d;
    x += x & (-x);
  }
}
int getans(int x) {
  int l = 1, r = n + 1;
  while (l < r) {
    int mid = (l + r) >> 1;
    int tmp = cal(mid);
    if (tmp < x)
      l = mid + 1;
    else
      r = mid;
  }
  return l;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    a[i]++;
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", &b[i]);
    b[i]++;
  }
  memset(bit, 0, sizeof(bit));
  for (int i = n - 1; i >= 0; --i) {
    pa[i] = cal(a[i]);
    update(a[i], 1);
  }
  reverse(pa, pa + n);
  memset(bit, 0, sizeof(bit));
  for (int i = n - 1; i >= 0; --i) {
    pb[i] = cal(b[i]);
    update(b[i], 1);
  }
  reverse(pb, pb + n);
  int should_inc = 0;
  for (int i = 1; i < n; ++i) {
    pc[i] = (should_inc + pa[i] + pb[i]) % (i + 1);
    should_inc = (should_inc + pa[i] + pb[i]) / (i + 1);
  }
  reverse(pc, pc + n);
  memset(bit, 0, sizeof(bit));
  for (int i = 1; i <= n; ++i) update(i, 1);
  for (int i = 0; i < n; ++i) {
    c[i] = getans(pc[i] + 1);
    update(c[i], -1);
  }
  for (int i = 0; i < n; ++i) {
    if (i) printf(" ");
    printf("%d", c[i] - 1);
  }
}
