#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int n;
int a[maxn];
int b[maxn];
int bit[maxn];
int c[maxn];
int d[maxn];
int e[maxn];
int ans[maxn];
void add(int x) {
  while (x <= n) {
    bit[x]++;
    x += x & -x;
  }
}
int sum(int x) {
  int ans = 0;
  while (x) {
    ans += bit[x];
    x -= x & -x;
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), a[i]++;
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]), b[i]++;
  for (int i = 1; i <= n; i++) {
    c[i] = a[i] - 1 - sum(a[i]);
    add(a[i]);
  }
  memset(bit, 0, sizeof bit);
  for (int i = 1; i <= n; i++) {
    d[i] = b[i] - 1 - sum(b[i]);
    add(b[i]);
  }
  int jin = 0;
  for (int i = n; i >= 1; i--) {
    e[i] = (c[i] + d[i] + jin) % (n - i + 1);
    jin = (c[i] + d[i] + jin) / (n - i + 1);
  }
  memset(bit, 0, sizeof bit);
  for (int i = 1; i <= n; i++) {
    int l = 0, r = n;
    while (l + 1 < r) {
      int mid = (l + r) >> 1;
      if (mid - sum(mid) >= e[i] + 1)
        r = mid;
      else
        l = mid;
    }
    ans[i] = r;
    add(r);
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i] - 1);
  printf("\n");
  return 0;
}
