#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 2e5 + 5;
const long long INF = 1e9;
const long long MOD = 1e9 + 33;
int n, potega = 1;
vector<int> p, q, tree;
vector<int> ord_p, ord_q, show;
void input() {
  cin >> n;
  while (potega < n) potega *= 2;
  p.resize(n + 5);
  q.resize(n + 5);
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    p[i]++;
  }
  for (int i = 0; i < n; i++) {
    cin >> q[i];
    q[i]++;
  }
}
void update(int _pos, int value = 1) {
  _pos += potega - 1;
  while (_pos) {
    tree[_pos] += value;
    _pos /= 2;
  }
}
int query(int _begin, int _end) {
  if (_begin > _end) return 0;
  _begin += potega - 1;
  _end += potega - 1;
  if (_begin == _end) return tree[_begin];
  if (_begin + 1 == _end) return tree[_begin] + tree[_end];
  int ans = tree[_begin] + tree[_end];
  while (_begin / 2 != _end / 2) {
    if (_begin % 2 == 0) ans += tree[_begin + 1];
    if (_end % 2 == 1) ans += tree[_end - 1];
    _begin /= 2;
    _end /= 2;
  }
  return ans;
}
vector<int> Ord(vector<int> &k) {
  vector<int> order;
  order.resize(n + 5);
  for (int i = 0; i < tree.size(); i++) tree[i] = 0;
  for (int i = n - 1; i >= 0; i--) {
    int p = k[i];
    update(p);
    order[i] = query(1, p - 1);
    if (i) order[i - 1] += (order[i] / (n - i));
    order[i] %= (n - i);
  }
  return order;
}
vector<int> operator+(vector<int> &v1, vector<int> &v2) {
  for (int i = n - 1; i >= 0; i--) {
    v1[i] += v2[i];
    if (i) v1[i - 1] += (v1[i] / (n - i));
    v1[i] %= (n - i);
  }
  return v1;
}
vector<int> Perm(vector<int> k) {
  vector<int> perm;
  perm.resize(n + 5);
  for (int i = 0; i < tree.size(); i++) tree[i] = 0;
  for (int i = 0; i < n; i++) {
    int p = k[i];
    p++;
    int pocz = 1, kon = n, sr;
    while (kon - pocz > 1) {
      sr = (pocz + kon) / 2;
      if (sr - query(1, sr) >= p)
        kon = sr;
      else
        pocz = sr;
    }
    if (pocz - query(1, pocz) == p)
      sr = pocz;
    else
      sr = kon;
    perm[i] = sr;
    update(sr);
  }
  return perm;
}
void solve() {
  tree.resize(2 * potega);
  ord_p = Ord(p);
  ord_q = Ord(q);
  show = Perm(ord_q + ord_p);
  for (int i = 0; i < n; i++) cout << show[i] - 1 << " ";
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  input();
  solve();
  return 0;
}
