#include <bits/stdc++.h>
using namespace std;
const long long linf = 1e18 + 5;
const int mod = (int)1e9 + 7;
const int logN = 17;
const int inf = 1e9;
const int N = 2e5 + 5;
int n, m, x, y, a[N], b[N], A[N], B[N], ANS[N], F[N], rem;
int que(int x) {
  int ans = 0;
  for (x++; x > 0; x -= x & -x) ans += F[x];
  return ans;
}
void upd(int x, int y) {
  for (x++; x < N; x += x & -x) F[x] += y;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    upd(a[i], 1);
  }
  for (int i = 1; i <= n; i++) {
    A[i] = que(a[i] - 1);
    upd(a[i], -1);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &b[i]);
    upd(b[i], 1);
  }
  for (int i = 1; i <= n; i++) {
    B[i] = que(b[i] - 1);
    upd(b[i], -1);
  }
  for (int i = 0; i <= n - 1; i++) upd(i, 1);
  for (int i = n; i >= 1; i--) {
    int C = n - i + 1, t = A[i] + B[i] + rem;
    ANS[i] = t % C;
    rem = t / C;
    ANS[i]++;
  }
  for (int i = 1; i <= n; i++) {
    int bas = 0, son = n - 1;
    while (bas < son) {
      if (que((bas + son >> 1)) >= ANS[i])
        son = (bas + son >> 1);
      else
        bas = (bas + son >> 1) + 1;
    }
    printf("%d ", bas);
    upd(bas, -1);
  }
  return 0;
}
