#include <bits/stdc++.h>
using namespace std;
int N;
int f[524288];
void add(int x, int val) {
  while (x < 524288) {
    f[x] += val;
    x += x & -x;
  }
}
int get(int x) {
  int sum = 0;
  while (x) {
    sum += f[x];
    x -= x & -x;
  }
  return sum;
}
vector<int> read_perm() {
  for (int i = 0; i < (524288); i++) f[i] = 0;
  vector<int> q;
  for (int i = 0; i < (N); i++) {
    int p;
    scanf("%d", &p);
    q.push_back(p - get(p));
    add(p + 1, 1);
  }
  return q;
}
int main(int argc, char *argv[]) {
  scanf("%d", &N);
  vector<int> q1 = read_perm();
  vector<int> q2 = read_perm();
  int rem = 0;
  for (int i = (N - 1); i >= (0); i--) {
    int a = q1[i] + q2[i] + rem;
    rem = (a >= N - i);
    q1[i] = a % (N - i);
  }
  for (int i = 0; i < (524288); i++) f[i] = 0;
  for (int i = 0; i < (N); i++) {
    int q = q1[i];
    int l = q, r = N - 1;
    while (l < r) {
      int m = (l + r) / 2;
      if (m - get(m + 1) >= q)
        r = m;
      else
        l = m + 1;
    }
    add(l + 1, 1);
    if (i) printf(" ");
    printf("%d", l);
  }
  printf("\n");
  return 0;
}
