#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int MOD = 1e9 + 7;
const double eps = 1e-9;
int ans[maxn];
struct FenwickTree {
  vector<int> tr;
  FenwickTree(int n) { tr.assign(n + 1, 0); }
  void update(int x, int val) {
    for (int i = x; i < (int)tr.size(); i += (i & -i)) {
      tr[i] += val;
    }
  }
  int get(int x) {
    int res = 0;
    for (int i = x; i > 0; i -= (i & -i)) {
      res += tr[i];
    }
    return res;
  }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cout << fixed;
  cout.precision(10);
  int n;
  cin >> n;
  for (int k = 0; k < 2; ++k) {
    FenwickTree del(n);
    for (int i = 0; i < n; ++i) {
      int val;
      cin >> val;
      ans[i] += val - del.get(val + 1);
      del.update(val + 1, 1);
    }
  }
  for (int i = n - 1; i >= 0; --i) {
    if (ans[i] >= n - i) {
      ans[i] -= (n - i);
      if (i > 0) ans[i - 1]++;
    }
  }
  FenwickTree del(n);
  for (int i = 0; i < n; ++i) {
    int pos = ans[i] + 1, ini = 1, fin = n;
    while (ini < fin) {
      int mid = (ini + fin) >> 1;
      if (mid - del.get(mid) < pos)
        ini = mid + 1;
      else
        fin = mid;
    }
    del.update(ini, 1);
    cout << ini - 1 << " ";
  }
  return 0;
}
