#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const int INF = 0x3f3f3f3f;
long long n;
int p[210000];
int q[210000];
int bit[210000];
void add(int i, int x) {
  while (i <= 210000) {
    bit[i] += x;
    i += (i & (-i));
  }
}
long long sum(int i) {
  int sum = 0;
  while (i > 0) {
    sum += bit[i];
    i -= (i & (-i));
  }
  return sum;
}
void solve() {
  int pq[210000];
  memset(pq, 0, sizeof(pq));
  for (int i = n; i >= 1; i--) {
    pq[i] += p[i] + q[i];
    if (pq[i] >= (n - i + 1)) {
      pq[i] -= (n - i + 1);
      pq[i - 1]++;
    }
  }
  int ans[210000];
  memset(ans, 0, sizeof(ans));
  memset(bit, 0, sizeof(bit));
  for (int i = 1; i <= n; i++) add(i, 1);
  int l, r, m;
  for (int i = 1; i <= n; i++) {
    l = 1, r = n;
    while (l <= r) {
      m = (l + r) >> 1;
      if (sum(m) >= pq[i] + 1)
        r = m - 1;
      else
        l = m + 1;
    }
    add(l, -1);
    pq[i] = l;
  }
  for (int i = 1; i < n; i++) {
    cout << pq[i] - 1 << " ";
  }
  cout << pq[n] - 1 << endl;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  int x;
  memset(bit, 0, sizeof(bit));
  for (int i = 1; i < n + 1; i++) {
    cin >> x;
    x++;
    p[i] = x - 1 - sum(x);
    add(x, 1);
  }
  memset(bit, 0, sizeof(bit));
  for (int i = 1; i < n + 1; i++) {
    cin >> x;
    x++;
    q[i] = x - 1 - sum(x);
    add(x, 1);
  }
  solve();
  return 0;
}
