#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const int LOGN = 31;
int fwt[MAXN];
int P[MAXN] = {0};
int n;
void update(int v, int d) {
  v++;
  for (; v <= n; v += v & -v) fwt[v] += d;
}
int query(int v) {
  int sum = 0;
  for (; v > 0; v -= v & -v) sum += fwt[v];
  return sum;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int j = 0; j < 2; j++) {
    memset(fwt, 0, sizeof(fwt));
    for (int i = 0; i < n; i++) {
      int v;
      cin >> v;
      P[i] += v - query(v);
      update(v, 1);
    }
  }
  int c = 0;
  for (int i = n - 1; i >= 0; i--) {
    int mod = n - i;
    if (P[i] >= mod) {
      P[i] -= mod;
      if (i) P[i - 1]++;
    }
  }
  memset(fwt, 0, sizeof(fwt));
  for (int i = 0; i < n; i++) update(i, 1);
  for (int i = 0; i < n; i++) {
    int sum = 0;
    int pos = 0;
    for (int j = LOGN; j >= 0; j--) {
      if (pos + (1LL << j) < n && sum + fwt[pos + (1LL << j)] < P[i] + 1) {
        sum += fwt[pos + (1LL << j)];
        pos += (1LL << j);
      }
    }
    cout << (pos) << " ";
    update(pos, -1);
  }
  cout << "\n";
}
