#include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 10;
int a[N];
int order[N];
int bit[N];
int n, ans, fact;
void ins(int x) {
  for (; x <= n; x += x & -x) {
    ++bit[x];
  }
}
int ask(int x) {
  int ret = 0;
  for (; x > 0; x -= x & -x) {
    ret += bit[x];
  }
  return ret;
}
void reContor(int *a, int n, int *order) {
  memset(bit, 0, sizeof bit);
  for (int i = n - 1; i >= 0; --i) {
    order[n - 1 - i] += ask(a[i]);
    ins(a[i]);
  }
}
void contor(int *a, int n, int *order) {
  memset(bit, 0, sizeof bit);
  for (int i = 0; i < n; ++i) {
    int l = 1, r = n;
    while (l <= r) {
      int m = l + r >> 1;
      int tmp = m - ask(m - 1) - 1;
      if (tmp <= order[n - 1 - i]) {
        a[i] = m;
        l = m + 1;
      } else {
        r = m - 1;
      }
    }
    ins(a[i]);
  }
}
int main() {
  scanf("%d", &n);
  fact = 1;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    ++a[i];
  }
  reContor(a, n, order);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    ++a[i];
  }
  reContor(a, n, order);
  for (int i = 0; i < n; ++i) {
    if (order[i] > i) {
      order[i] -= i + 1;
      ++order[i + 1];
    }
  }
  contor(a, n, order);
  for (int i = 0; i < n; ++i) {
    printf("%d ", a[i] - 1);
  }
  printf("\n");
  return 0;
}
