#include <bits/stdc++.h>
using namespace std;
int p[200005], q[200005];
int C[200005];
int d1[200005], d2[200005];
int ans[200005];
int sum(int x) {
  int ret = 0;
  while (x > 0) {
    ret += C[x];
    x -= (x & (-x));
  }
  return ret;
}
void add(int x) {
  while (x <= 200001) {
    C[x]++;
    x += (x & (-x));
  }
}
int erfen(int d, int n) {
  int l = 1, r = n, mid, ans;
  while (l <= r) {
    mid = (l + r) / 2;
    if (mid - 1 - sum(mid - 1) <= d) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  return ans;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &p[i]);
    p[i]++;
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &q[i]);
    q[i]++;
  }
  memset(C, 0, sizeof(C));
  for (int i = 0; i < n; i++) {
    d1[i] = p[i] - sum(p[i] - 1) - 1;
    add(p[i]);
  }
  memset(C, 0, sizeof(C));
  for (int i = 0; i < n; i++) {
    d2[i] = q[i] - sum(q[i] - 1) - 1;
    add(q[i]);
  }
  for (int i = n - 1; i >= 0; i--) {
    d1[i] = d1[i] + d2[i];
    if (d1[i] >= (n - i)) {
      d1[i] -= (n - i);
      if (i != 0) d1[i - 1]++;
    }
  }
  memset(C, 0, sizeof(C));
  for (int i = 0; i < n; i++) {
    ans[i] = erfen(d1[i], n);
    add(ans[i]);
  }
  for (int i = 0; i < n - 1; i++) printf("%d ", ans[i] - 1);
  printf("%d\n", ans[n - 1] - 1);
}
