#include <bits/stdc++.h>
using namespace std;
int bit[200010], n;
int a[200010], b[200010], c[200010];
bool f[200010];
void update(int i) {
  while (i <= n) {
    bit[i] += 1;
    i = i + (i & (-i));
  }
}
int query(int i) {
  int ret = 0;
  while (i) {
    ret += bit[i];
    i = i - (i & (-i));
  }
  return ret;
}
int main() {
  int x, i;
  scanf("%d", &n);
  memset(bit, 0, sizeof(bit));
  for (i = 0; i < n; ++i) {
    scanf("%d", &x);
    a[i] = x - query(x + 1);
    update(x + 1);
  }
  memset(bit, 0, sizeof(bit));
  for (i = 0; i < n; ++i) {
    scanf("%d", &x);
    b[i] = x - query(x + 1);
    update(x + 1);
  }
  int carry = 0;
  for (i = n - 1; i >= 0; --i) {
    c[i] = a[i] + b[i] + carry;
    carry = c[i] / (n - i);
    c[i] = c[i] % (n - i);
  }
  memset(bit, 0, sizeof(bit));
  memset(f, 0, sizeof(f));
  for (i = 0; i < n; ++i) {
    int lo = 0, hi = n - 1, mid;
    mid = (lo + hi) / 2;
    while (lo < hi) {
      int val = query(mid);
      val = mid - val;
      if (f[mid]) {
        if (val > c[i]) {
          hi = mid - 1;
        } else
          lo = mid + 1;
      } else {
        if (val == c[i]) {
          break;
        } else if (val < c[i]) {
          lo = mid + 1;
        } else {
          hi = mid - 1;
        }
      }
      mid = (lo + hi) / 2;
    }
    printf("%d ", mid);
    f[mid] = 1;
    update(mid + 1);
  }
}
