#include <bits/stdc++.h>
using namespace std;
int z, n;
set<int> sa;
set<int> sb;
int inva[200007];
int invb[200007];
int invc[200007];
int a[200007];
int b[200007];
struct fenwick {
  int ft[200007];
  fenwick() {
    for (int i = 0; i <= n; i++) ft[i] = 0;
  }
  void clear() {}
  void insert(int x, long long v) {
    x++;
    for (; x <= n; x += x & -x) ft[x] += v;
  }
  int query(int x) {
    x++;
    if (x < 1) return 0;
    int res = 0;
    for (; x; x -= x & -x) res += ft[x];
    return res;
  }
  int q(int x) { return (n - x) - (query(n - 1) - query(x - 1)); }
};
fenwick ta, tb, tc;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    inva[i] = a[i] - ta.query(a[i]);
    ta.insert(a[i], 1);
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    invb[i] = b[i] - tb.query(b[i]);
    tb.insert(b[i], 1);
  }
  for (int i = 0; i < n; i++) invc[i] = (inva[i] + invb[i]);
  for (int i = n - 1; i >= 0; i--) {
    if (invc[i] >= n - i) {
      if (i) invc[i - 1]++;
      invc[i] %= (n - i);
    }
  }
  for (int i = 0; i < n; i++) {
    int l = 0, r = n - 1;
    if (!i) {
      cout << invc[i] << " ";
      tc.insert(invc[i], 1);
    } else {
      while (l < r) {
        int m = (l + r) / 2;
        if (m - tc.query(m) >= invc[i])
          r = m;
        else
          l = m + 1;
      }
      tc.insert(l, 1);
      cout << l << " ";
    }
  }
  cout << endl;
  return 0;
}
