#include <bits/stdc++.h>
using namespace std;
const int nmax = 2e5 + 55;
int s[nmax];
int ans[nmax];
int n;
void update(int i) {
  for (; i <= n; i += i & (-i)) s[i]++;
}
int query(int i) {
  int ans = 0;
  for (; i; i -= i & (-i)) ans += s[i];
  return ans;
}
int main(void) {
  ios_base ::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    int aux;
    cin >> aux;
    ++aux;
    ans[i] += aux - query(aux) - 1;
    update(aux);
  }
  memset(s, 0, sizeof(s));
  for (int i = 1; i <= n; ++i) {
    int aux;
    cin >> aux;
    ++aux;
    ans[i] += aux - query(aux) - 1;
    update(aux);
  }
  int cnt = 1;
  for (int i = n; i; --i) {
    ans[i - 1] += ans[i] / cnt;
    ans[i] = ans[i] % cnt;
    ++cnt;
  }
  memset(s, 0, sizeof(s));
  for (int i = 1; i <= n; ++i) {
    ++ans[i];
    int bst = 0;
    for (int k = (1 << 20); k; k >>= 1)
      if (bst + k <= n)
        if (bst + k - query(bst + k) < ans[i]) bst += k;
    ++bst;
    cout << bst - 1 << ' ';
    update(bst);
  }
  return cout << '\n', 0;
}
