#include <bits/stdc++.h>
using namespace std;
int s[200000 + 2];
int f[200000 + 2];
void add(int x, int d) {
  while (x <= 200000) {
    s[x] += d;
    x += (x & (-x));
  }
}
int getsum(int x) {
  int ans = 0;
  while (x > 0) {
    ans += s[x];
    x -= (x & (-x));
  }
  return ans;
}
void init(int n) {
  memset(s, 0, sizeof(s));
  for (int i = 1; i <= n; i++) {
    add(i, 1);
  }
}
void test(int n) {
  puts("test");
  for (int i = 0; i < n; i++) {
    printf("%d ", f[i]);
  }
  puts("");
}
int main() {
  int n;
  int tmp;
  while (scanf("%d", &n) != EOF) {
    init(n);
    for (int i = 0; i < n; i++) {
      scanf("%d", &tmp);
      tmp++;
      f[i] = getsum(tmp) - 1;
      add(tmp, -1);
    }
    init(n);
    for (int i = 0; i < n; i++) {
      scanf("%d", &tmp);
      tmp++;
      f[i] += getsum(tmp) - 1;
      add(tmp, -1);
    }
    for (int i = n - 1; i >= 0; i--) {
      while (f[i] >= n - i) {
        f[i] -= (n - i);
        if (i - 1 >= 0) {
          f[i - 1]++;
        }
      }
    }
    init(n);
    for (int i = 0; i < n; i++) {
      int tar = f[i] + 1;
      int l = 1, r = n + 1;
      int ans;
      while (l < r) {
        int m = (l + r) / 2;
        int sum = getsum(m);
        if (sum < tar) {
          l = m + 1;
        } else {
          r = m;
        }
        if (sum == tar) {
          ans = m;
        }
      }
      add(ans, -1);
      if (i == n - 1) {
        printf("%d\n", ans - 1);
      } else {
        printf("%d ", ans - 1);
      }
    }
  }
  return 0;
}
