#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 9;
int a[N], T[N];
int n;
void home() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
void upd(int u, int v) {
  for (; u <= n; u += u & (-u)) T[u] += v;
}
int get(int u) {
  int ans = 0;
  for (; u > 0; u &= u - 1) ans += T[u];
  return ans;
}
void init() {
  for (int i = (0); i <= (n + 1); ++i) T[i] = 0;
  for (int i = (1); i <= (n); ++i) upd(i, 1);
}
void doc() {
  int x;
  for (int i = (1); i <= (n); ++i) {
    cin >> x;
    ++x;
    a[n - i] += get(x - 1);
    upd(x, -1);
  }
}
void enter() {
  cin >> n;
  init();
  doc();
  init();
  doc();
}
void solve() {
  for (int i = (1); i <= (n - 1); ++i) {
    if (a[i] <= i) continue;
    ++a[i + 1];
    a[i] -= (i + 1);
  }
  init();
  a[0] = 0;
  int l, r, mid;
  for (int i = (n - 1); i >= (0); --i) {
    l = 1, r = n;
    while (l < r) {
      mid = (l + r + 1) >> 1;
      if (get(mid - 1) <= a[i])
        l = mid;
      else
        r = mid - 1;
    }
    upd(l, -1);
    cout << l - 1 << " ";
  }
}
int main() {
  home();
  enter();
  solve();
}
