#include <bits/stdc++.h>
using namespace std;
const int maxn = 200007;
int bit[maxn];
int n, a[maxn], res[maxn];
void add(int i, int v) {
  for (; i <= n; i += i & (-i)) bit[i] += v;
}
int get(int i) {
  int res = 0;
  for (; i; i -= i & (-i)) res += bit[i];
  return res;
}
int get_th(int th) {
  int l = 1, r = n, mid, res;
  while (l <= r) {
    mid = (l + r) / 2;
    if (get(mid) > th) {
      res = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  return res;
}
int main() {
  scanf("%d", &n);
  int v;
  memset(bit, 0, sizeof(bit));
  for (int i = 1; i <= n; ++i) add(i, 1);
  for (int i = n; i >= 1; --i) {
    scanf("%d", &v);
    ++v;
    int x = get(v - 1);
    a[i] = x;
    add(v, -1);
  }
  memset(bit, 0, sizeof(bit));
  for (int i = 1; i <= n; ++i) add(i, 1);
  for (int i = n; i >= 1; --i) {
    scanf("%d", &v);
    ++v;
    int x = get(v - 1);
    a[i] += x;
    add(v, -1);
  }
  for (int i = 2, t = 0; i <= n; ++i) {
    a[i] += t;
    t = a[i] / i;
    a[i] %= i;
  }
  memset(bit, 0, sizeof(bit));
  for (int i = 1; i <= n; ++i) add(i, 1);
  for (int i = n; i >= 1; --i) {
    res[i] = get_th(a[i]);
    add(res[i], -1);
  }
  for (int i = n; i >= 1; --i) printf("%d ", res[i] - 1);
}
