#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
int c[MAXN];
int lowbit(int x) { return x & (-x); }
int sum(int i) {
  int s = 0;
  while (i > 0) {
    s += c[i];
    i -= lowbit(i);
  }
  return s;
}
int n;
void add(int i, int val) {
  while (i <= n) {
    c[i] += val;
    i += lowbit(i);
  }
}
int a[MAXN], b[MAXN];
int s[MAXN];
int main() {
  while (scanf("%d", &n) == 1) {
    for (int i = 0; i < n; i++) scanf("%d", &a[i]);
    for (int i = 0; i < n; i++) scanf("%d", &b[i]);
    memset(s, 0, sizeof(s));
    memset(c, 0, sizeof(c));
    for (int i = n - 1; i >= 0; i--) {
      s[n - 1 - i] += sum(a[i]);
      add(a[i] + 1, 1);
    }
    memset(c, 0, sizeof(c));
    for (int i = n - 1; i >= 0; i--) {
      s[n - 1 - i] += sum(b[i]);
      add(b[i] + 1, 1);
    }
    memset(c, 0, sizeof(c));
    for (int i = 0; i < n; i++) {
      s[i + 1] += s[i] / (i + 1);
      s[i] %= (i + 1);
    }
    for (int i = 1; i <= n; i++) add(i, 1);
    for (int i = n - 1; i >= 0; i--) {
      int l = 1, r = n;
      int id = n;
      while (l <= r) {
        int mid = (l + r) / 2;
        if (sum(mid) >= s[i] + 1) {
          id = mid;
          r = mid - 1;
        } else
          l = mid + 1;
      }
      add(id, -1);
      printf("%d ", id - 1);
    }
    printf("\n");
  }
  return 0;
}
