#include <bits/stdc++.h>
using namespace std;
int number[200000];
int fenTree[200000];
int n;
void add(int index, int value) {
  for (; index < n; index |= (index + 1)) fenTree[index] += value;
}
int get(int index) {
  int ans = 0;
  for (; index >= 0; index = (index & (index + 1)) - 1) ans += fenTree[index];
  return ans;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) add(i, 1);
  for (int i = 0; i < n; i++) {
    int num;
    scanf("%d", &num);
    number[i] = get(num) - 1;
    add(num, -1);
  }
  for (int i = 0; i < n; i++) fenTree[i] = 0;
  for (int i = 0; i < n; i++) add(i, 1);
  for (int i = 0; i < n; i++) {
    int num;
    scanf("%d", &num);
    number[i] += get(num) - 1;
    add(num, -1);
  }
  for (int i = n - 1; i >= 1; i--) {
    number[i - 1] += number[i] / (n - i);
    number[i] %= (n - i);
  }
  number[0] %= n;
  for (int i = 0; i < n; i++) fenTree[i] = 0;
  for (int i = 0; i < n; i++) add(i, 1);
  for (int i = 0; i < n; i++) {
    int l = 0, r = n - 1;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (get(mid) - 1 < number[i])
        l = mid + 1;
      else
        r = mid;
      if (l == r) break;
    }
    printf("%d ", l);
    add(l, -1);
  }
  return 0;
}
