#include <bits/stdc++.h>
using namespace std;
struct Fenwick {
  vector<int> ar;
  Fenwick(int n) : ar(n) {}
  int sum(int r) {
    int res = 0;
    for (; r >= 0; r = (r & (r + 1)) - 1) {
      res += ar[r];
    }
    return res;
  }
  void inc(int i, int delta) {
    for (; i < ar.size(); i = i | (i + 1)) ar[i] += delta;
  }
  int getid(int v) {
    ++v;
    int lo = -1, hi = ar.size() - 1;
    while (lo < hi) {
      int mid = lo + (hi - lo) / 2;
      if (sum(mid) >= v) {
        hi = mid;
      } else {
        lo = mid + 1;
      }
    }
    return lo;
  }
};
vector<int> vrank(vector<int> const& v) {
  vector<int> res(v.size());
  Fenwick fw(v.size());
  for (size_t i = 0; i < v.size(); ++i) {
    int d = fw.sum(v[i]);
    res[i] = v[i] - d;
    fw.inc(v[i], 1);
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  while (cin >> n) {
    vector<int> a(n), b(n);
    for (int i = 0; i < n; ++i) cin >> a[i];
    for (int i = 0; i < n; ++i) cin >> b[i];
    vector<int> arank = vrank(a);
    vector<int> brank = vrank(b);
    vector<int> crank(n);
    for (int i = 0; i < n; ++i) {
      crank[i] = arank[i] + brank[i];
    }
    for (int i = n - 1; i > 0; --i) {
      int d = crank[i] / (n - i);
      int r = crank[i] % (n - i);
      crank[i - 1] += d;
      crank[i] = r;
    }
    crank[0] %= n;
    vector<int> c(n);
    Fenwick fw(n);
    for (int i = 0; i < n; ++i) {
      fw.inc(i, 1);
    }
    for (int i = 0; i < n; ++i) {
      c[i] = fw.getid(crank[i]);
      fw.inc(c[i], -1);
    }
    for (int i = 0; i < n; ++i) cout << c[i] << ' ';
    cout << endl;
  }
}
