#include <bits/stdc++.h>
using namespace std;
int p[200005], q[200005], p_fac[200005], q_fac[200005], sum[200005],
    ans[200005];
int bit[200005], n;
void update(int ind, int val) {
  while (ind <= n) {
    bit[ind] += val;
    ind += (ind) & (-ind);
  }
}
int query(int ind) {
  int ret = 0;
  while (ind >= 1) {
    ret += bit[ind];
    ind -= (ind) & (-ind);
  }
  return ret;
}
int find(int cnt) {
  int lo = 1, hi = n;
  while (lo < hi) {
    int mi = (lo + hi) / 2;
    if (query(mi) > cnt)
      hi = mi - 1;
    else if (query(mi) < cnt)
      lo = mi + 1;
    else
      hi = mi;
  }
  return lo;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> p[i];
    p[i] += 1;
  }
  for (int i = 1; i <= n; i++) {
    cin >> q[i];
    q[i] += 1;
  }
  for (int i = 1; i <= n; i++) update(i, 1);
  for (int j = 1; j <= n; j++) {
    int temp = query(p[j]);
    update(p[j], -1);
    p_fac[j] += temp - 1;
  }
  memset(bit, 0, sizeof(bit));
  for (int i = 1; i <= n; i++) update(i, 1);
  for (int j = 1; j <= n; j++) {
    int temp = query(q[j]);
    update(q[j], -1);
    q_fac[j] += temp - 1;
  }
  for (int i = 1; i <= n; i++) {
    sum[i] = p_fac[i] + q_fac[i];
  }
  for (int i = 0; i <= n - 1; i++) {
    if (sum[n - i] > i) {
      sum[n - i] -= i + 1;
      sum[n - i - 1] += 1;
    }
  }
  memset(bit, 0, sizeof(bit));
  for (int i = 1; i <= n; i++) update(i, 1);
  for (int i = 1; i <= n; i++) {
    int temp = find(sum[i] + 1);
    update(temp, -1);
    ans[i] = temp;
  }
  for (int i = 1; i <= n; i++) cout << ans[i] - 1 << " ";
  cout << endl;
}
