#include <bits/stdc++.h>
using namespace std;
bool Z[200005];
int A[200005], B[200005], C[200005], T[200005], ctos, van = 1, uno = 0, x, y,
                                                      mid, es;
void up(int idx) {
  while (idx <= ctos) {
    ++T[idx];
    idx += (idx & (-idx));
  }
}
int read(int idx) {
  int sum = 0;
  while (idx > 0) {
    sum += T[idx];
    idx -= (idx & (-idx));
  }
  return sum;
}
int main() {
  scanf("%d", &ctos);
  for (int i = 1; i <= ctos; i++) {
    scanf("%d", &A[i]);
    ++A[i];
  }
  for (int i = ctos; i > 0; i--) {
    up(A[i]);
    A[i] = read(A[i]);
  }
  for (int i = 1; i <= ctos; i++) {
    T[i] = 0;
  }
  for (int i = 1; i <= ctos; i++) {
    scanf("%d", &B[i]);
    ++B[i];
  }
  for (int i = ctos; i > 0; i--) {
    up(B[i]);
    B[i] = read(B[i]);
  }
  for (int i = ctos; i > 0; i--) {
    C[i] = A[i] + B[i] - 1 + uno;
    if (C[i] > van) {
      C[i] = C[i] - van;
      uno = 1;
    } else {
      uno = 0;
    }
    ++van;
  }
  for (int i = 1; i <= ctos; i++) {
    T[i] = 0;
  }
  for (int i = 1; i <= ctos; i++) {
    x = 1;
    y = ctos;
    while (x < y) {
      mid = (x + y) / 2;
      es = mid - read(mid);
      if (es < C[i]) {
        x = mid + 1;
      } else if (es == C[i]) {
        if (Z[mid]) {
          y = mid - 1;
        } else {
          x = y = mid;
          break;
        }
      } else {
        y = mid - 1;
      }
    }
    printf("%d ", x - 1);
    Z[x] = true;
    up(x);
  }
  printf("\n");
  return 0;
}
