#include <bits/stdc++.h>
using namespace std;
const int MN = 200111;
int bit[MN], a[3][MN], n;
int get(int u) {
  int res = 0;
  while (u > 0) {
    res += bit[u];
    u -= ((u) & (-(u)));
  }
  return res;
}
void update(int u, int val) {
  while (u <= n) {
    bit[u] += val;
    u += ((u) & (-(u)));
  }
}
int main() {
  ios ::sync_with_stdio(false);
  cout << (fixed) << setprecision(9);
  while (cin >> n) {
    for (int turn = 0, _a = (2); turn < _a; turn++) {
      for (int i = (1), _b = (n); i <= _b; i++) {
        cin >> a[turn][i];
        ++a[turn][i];
      }
    }
    for (int turn = 0, _a = (2); turn < _a; turn++) {
      memset(bit, 0, sizeof bit);
      for (int i = (1), _b = (n); i <= _b; i++) {
        int u = a[turn][i];
        a[turn][i] -= get(u) + 1;
        update(u, 1);
      }
    }
    memset(a[2], 0, sizeof a[2]);
    for (int i = (n), _b = (1); i >= _b; i--) {
      a[2][i] += a[0][i] + a[1][i];
      int avail = n - i + 1;
      a[2][i - 1] += a[2][i] / avail;
      a[2][i] %= avail;
    }
    memset(bit, 0, sizeof bit);
    for (int i = (1), _b = (n); i <= _b; i++) {
      int l = 1, r = n, res = r;
      while (l <= r) {
        int mid = (l + r) >> 1;
        if (mid - get(mid) >= a[2][i] + 1) {
          res = mid;
          r = mid - 1;
        } else
          l = mid + 1;
      }
      a[2][i] = res;
      update(res, 1);
    }
    for (int i = (1), _b = (n); i <= _b; i++) cout << a[2][i] - 1 << ' ';
    cout << endl;
  }
  return 0;
}
