#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 * 100 * 2 + 1000;
int n, lim, a[MAXN], ans[MAXN], b[MAXN], res[MAXN];
int f[MAXN][2];
void ADD(int id, int val = 1) {
  while (id <= n) {
    b[id] += val;
    id += id & -id;
  }
}
int Ask(int id) {
  int sum = 0;
  while (id > 0) {
    sum += b[id];
    id -= id & -id;
  }
  return sum;
}
int main() {
  cin >> n;
  for (int x = 0; x < 2; x++) {
    memset(b, 0, sizeof b);
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      a[i]++;
    }
    for (int i = n - 1; i >= 0; i--) {
      f[i][x] = Ask(a[i]);
      ADD(a[i]);
    }
  }
  lim = -1;
  for (int i = n - 1; i >= 0; i--) {
    lim++;
    res[i] += f[i][0] + f[i][1];
    if (res[i] > lim) {
      res[i] -= (lim + 1);
      if (i > 0) res[i - 1]++;
    }
  }
  for (int i = 0; i < n; i++) {
    int l = 0, r = n;
    while (r - l > 1) {
      int mid = (l + r) / 2;
      int j = Ask(mid);
      if (j > res[i])
        r = mid;
      else
        l = mid;
    }
    ans[i] = r - 1;
    ADD(r, -1);
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
