#include <bits/stdc++.h>
using namespace std;
int a[400000], b[400000], c[400000], p1[400000], p2[400000], p[400000], n;
void add(int x, int v) {
  while (x <= n) c[x] += v, x += ((x) & (-x));
}
int sum(int x) {
  int res = 0;
  while (x) res += c[x], x -= ((x) & (-x));
  return res;
}
int main() {
  scanf("%d", &n);
  memset(c, 0, sizeof(c));
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    a[i]++;
  }
  for (int i = n; i >= 1; i--) {
    p1[i] = sum(a[i] - 1);
    add(a[i], 1);
  }
  memset(c, 0, sizeof(c));
  for (int i = 1; i <= n; i++) {
    scanf("%d", &b[i]);
    b[i]++;
  }
  for (int i = n; i >= 1; i--) {
    p2[i] = sum(b[i] - 1);
    add(b[i], 1);
  }
  int jw = 0;
  for (int i = n; i >= 1; i--) {
    int t = n - i + 1;
    p[i] = (p1[i] + p2[i] + jw) % t;
    jw = (p1[i] + p2[i] + jw) / t;
  }
  memset(c, 0, sizeof(c));
  for (int i = 1; i <= n; i++) add(i, 1);
  for (int i = 1; i <= n; i++) {
    int l = 1, r = n;
    while (l < r) {
      int mid = (l + r + 1) >> 1;
      if (sum(mid - 1) > p[i])
        r = mid - 1;
      else
        l = mid;
    }
    printf("%d ", l - 1);
    add(l, -1);
  }
  return 0;
}
