#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
int n, coef[MAXN], ft[MAXN];
void init_ft(int val) {
  for (int i = 0; i <= n; ++i) ft[i] = 0;
  for (int i = 1; i <= n; ++i) {
    ft[i] += val;
    if (i + (i & (-i)) <= n) ft[i + (i & (-i))] += ft[i];
  }
}
int get_sum(int pos) {
  int ans = 0;
  for (int i = pos; i; i -= i & (-i)) {
    ans += ft[i];
  }
  return ans;
}
void add(int pos, int val) {
  for (int i = pos; i <= n; i += i & (-i)) {
    ft[i] += val;
  }
}
int ft_search(int val) {
  int ans = 0;
  for (int i = 31 - __builtin_clz(n); i >= 0; --i) {
    int n_ans = ans | (1 << i);
    if (n_ans <= n && ft[n_ans] <= val) {
      val -= ft[n_ans];
      ans = n_ans;
    }
  }
  return ans;
}
int main() {
  memset(coef, 0, sizeof coef);
  scanf("%d", &n);
  init_ft(1);
  for (int i = 0, num; i < n; ++i) {
    scanf("%d", &num);
    ++num;
    coef[i] += get_sum(num) - 1;
    add(num, -1);
  }
  init_ft(1);
  for (int i = 0, num; i < n; ++i) {
    scanf("%d", &num);
    ++num;
    coef[i] += get_sum(num) - 1;
    add(num, -1);
  }
  for (int i = n - 1; i >= 0; --i) {
    int mod = n - i;
    if (coef[i] >= mod && i) ++coef[i - 1];
    coef[i] %= mod;
  }
  init_ft(1);
  for (int i = 0; i < n; ++i) {
    int pos = ft_search(coef[i]) + 1;
    add(pos, -1);
    printf("%d ", pos - 1);
  }
  puts("");
  return 0;
}
