#include <bits/stdc++.h>
using namespace std;
int C[200100], A[200100], B[200100], xa[200100], xb[200100], x[200100], n, i;
void Add(int x, int v) {
  for (; x <= n; x += ((x) & (-x))) C[x] += v;
}
int Getsum(int x) {
  int s = 0;
  for (; x; x -= ((x) & (-x))) s += C[x];
  return s;
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &A[i]), A[i]++;
  for (i = 1; i <= n; i++) scanf("%d", &B[i]), B[i]++;
  for (i = 1; i <= n; i++) {
    xa[i] = A[i] - 1 - Getsum(A[i]);
    Add(A[i], 1);
  }
  memset(C, 0, sizeof(C));
  for (i = 1; i <= n; i++) {
    xb[i] = B[i] - 1 - Getsum(B[i]);
    Add(B[i], 1);
  }
  for (i = n; i >= 1; i--) x[i] = xa[i] + xb[i];
  for (i = n; i >= 1; i--)
    if (x[i] >= (n - i + 1))
      x[i - 1] += x[i] / (n - i + 1), x[i] %= (n - i + 1);
  memset(C, 0, sizeof(C));
  for (i = 1; i <= n; i++) {
    int l = x[i] + 1, r = n, ans = x[i] + 1;
    while (l <= r) {
      int mid = (l + r) >> 1;
      int s = mid - Getsum(mid - 1) - 1;
      if (s <= x[i])
        ans = mid, l = mid + 1;
      else
        r = mid - 1;
    }
    printf("%d ", ans - 1);
    Add(ans, 1);
  }
  return 0;
}
