#include <bits/stdc++.h>
using namespace std;
long n, q, v1[1 << 20], v2[1 << 20], t[1 << 20];
long get(long r) {
  int res = 0;
  for (; r >= 0; r = (r & (r + 1)) - 1) res += t[r];
  return res;
}
void inc(long i, long val) {
  for (; i < (1 << 20); i = (i | (i + 1))) t[i] += val;
}
long ans[1 << 20];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> q;
    v1[i] += q - get(q);
    inc(q, 1);
  }
  for (int i = 0; i < (1 << 20); i++) t[i] = 0;
  for (int i = 0; i < n; i++) {
    cin >> q;
    v2[i] = q - get(q);
    inc(q, 1);
  }
  int rem = 0;
  int b = 1;
  for (int i = n - 1; i >= 0; --i) {
    v1[i] += v2[i];
    v1[i] += rem;
    if (v1[i] >= b) {
      rem = 1;
      v1[i] -= b;
    } else
      rem = 0;
    ++b;
  }
  for (int i = 0; i < (1 << 20); i++) t[i] = 0;
  for (int i = 0; i < n; i++) {
    long l, r;
    l = 0;
    r = n - 1;
    while (l < r) {
      long mid = l + r;
      mid /= 2;
      if (mid - get(mid) + 1 >= v1[i] + 1)
        r = mid;
      else
        l = mid + 1;
    }
    ans[i] = l;
    inc(ans[i], 1);
  }
  for (int i = 0; i < n; i++) {
    if (i) cout << " ";
    cout << ans[i];
  }
  cout << endl;
  cin.get();
  cin.get();
  return 0;
}
