#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 10;
int BIT[maxn], n, num[maxn];
int lowbit(int x) { return x & -x; }
void modify(int p, int v) {
  while (p <= n) {
    BIT[p] += v;
    p += lowbit(p);
  }
}
int query(int p) {
  int ret = 0;
  while (p > 0) {
    ret += BIT[p];
    p -= lowbit(p);
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int t;
    scanf("%d", &t);
    num[i] = t - query(t + 1);
    modify(t + 1, 1);
  }
  memset(BIT, 0, sizeof(BIT));
  for (int i = 1; i <= n; i++) {
    int t;
    scanf("%d", &t);
    num[i] += t - query(t + 1);
    modify(t + 1, 1);
  }
  for (int i = n; i > 0; i--) {
    num[i - 1] += num[i] / (n - i + 1);
    num[i] %= n - i + 1;
  }
  auto solve = [](int num) {
    int l = 1, r = n;
    while (r > l) {
      int m = (l + r) / 2;
      if (query(m) >= num)
        r = m;
      else
        l = m + 1;
    }
    modify(l, -1);
    return l - 1;
  };
  for (int i = 1; i <= n; i++) {
    printf("%d%c", solve(num[i] + 1), " \n"[i == n]);
  }
}
