#include <bits/stdc++.h>
using namespace std;
int bit[200005], N;
int read(int k) {
  int sum = 0;
  while (k > 0) {
    sum += bit[k];
    k -= (k & -k);
  }
  return sum;
}
void update(int i, int v) {
  while (i <= N) {
    bit[i] += v;
    i += (i & -i);
  }
}
int a[200005], b[200005], s[200005];
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) cin >> a[i];
  for (int i = 0; i < N; i++) cin >> b[i];
  for (int i = N - 1; i >= 0; i--) {
    s[i] += read(a[i] + 1);
    update(a[i] + 1, 1);
  }
  for (int i = 0; i <= N; i++) bit[i] = 0;
  for (int i = N - 1; i >= 0; i--) {
    s[i] += read(b[i] + 1);
    update(b[i] + 1, 1);
  }
  for (int i = N - 1; i >= 1; i--) {
    int m = N - i;
    s[i - 1] += s[i] / m;
    s[i] %= m;
  }
  s[0] %= N;
  for (int i = 1; i <= N; i++) bit[i] = 0;
  for (int i = 1; i <= N; i++) update(i, 1);
  for (int i = 0; i < N; i++) {
    int goal = s[i] + 1;
    int l = 1, h = N, m;
    while (h - l > 1) {
      m = (l + h) / 2;
      if (read(m) < goal)
        l = m;
      else
        h = m;
    }
    if (read(l) == goal)
      m = l;
    else
      m = h;
    update(m, -1);
    cout << m - 1;
    if (i < N - 1) cout << " ";
  }
  cout << endl;
  return 0;
}
