#include <bits/stdc++.h>
using namespace std;
int N;
int A[200005];
int B[200005];
int C[200005];
int cumfreq(int i) {
  int j = 0;
  for (int k = i; k > 0; k -= (k & (-k))) j += C[k];
  return j;
}
void update(int i, int j) {
  for (int k = i; k <= N; k += (k & (-k))) C[k] += j;
}
void ordinal(int D[]) {
  fill_n(C, N + 5, 0);
  for (int i = 1; i <= N; i++) {
    update(i, 1);
  }
  for (int i = 0; i < N; i++) {
    int j = cumfreq(D[i]);
    update(D[i] + 1, -1);
    D[i] = j;
  }
}
void permu(int D[]) {
  fill_n(C, N + 5, 0);
  for (int i = 1; i <= N; i++) {
    update(i, 1);
  }
  for (int i = 0; i < N; i++) {
    int low = 0;
    int high = N;
    while (low + 1 < high) {
      int mid = (low + high) / 2;
      if (cumfreq(mid) <= D[i]) {
        low = mid;
      } else
        high = mid;
    }
    D[i] = low;
    update(low + 1, -1);
  }
}
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) scanf("%d", &A[i]);
  for (int i = 0; i < N; i++) scanf("%d", &B[i]);
  ordinal(A);
  ordinal(B);
  int x = 0;
  for (int i = N - 1; i >= 0; i--) {
    x += A[i] + B[i];
    A[i] = (x % (N - i));
    x /= (N - i);
  }
  permu(A);
  for (int i = 0; i < N; i++) printf("%d ", A[i]);
  cout << endl;
  return 0;
}
