#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
int n;
int p[maxn];
int q[maxn];
int a[maxn];
int b[maxn];
int c[maxn];
int fen[maxn];
void add(int p, int val) {
  for (p++; p < maxn; p += p & -p) fen[p] += val;
}
int get(int p) {
  int res = 0;
  for (; p > 0; p -= p & -p) res += fen[p];
  return res;
}
void solve() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", p + i);
  for (int i = 0; i < n; i++) scanf("%d", q + i);
  memset(fen, 0, sizeof fen);
  for (int i = n - 1; i >= 0; i--) {
    a[i] = get(p[i]);
    add(p[i], 1);
  }
  memset(fen, 0, sizeof fen);
  for (int i = n - 1; i >= 0; i--) {
    b[i] = get(q[i]);
    add(q[i], 1);
  }
  int m = 0;
  for (int i = n - 1; i >= 0; i--) {
    int k = a[i] + b[i] + m;
    m = k / (n - i);
    c[i] = k % (n - i);
  }
  memset(fen, 0, sizeof fen);
  for (int i = 0; i < n; i++) {
    int l = 0, r = n - 1;
    while (l < r) {
      int mid = (l + r) >> 1;
      if (mid - get(mid + 1) < c[i])
        l = mid + 1;
      else
        r = mid;
    }
    printf("%d ", l);
    add(l, 1);
  }
}
int main() { solve(); }
