#include <bits/stdc++.h>
using namespace std;
int bit[200005];
int getsum(int x) {
  int sum = 0;
  while (x > 0) {
    sum += bit[x];
    x -= (x & -x);
  }
  return sum;
}
int n;
void update(int x, int num) {
  while (x <= n) {
    bit[x] += num;
    x += (x & -x);
  }
}
inline void initBIT() {
  memset(bit, 0, sizeof(bit));
  for (int i = 1; i <= n; i++) update(i, 1);
}
void read(int *x) {
  initBIT();
  for (int i = n - 1; ~i; i--) {
    int a;
    scanf("%d", &a);
    x[i] = getsum(a + 1) - 1;
    update(a + 1, -1);
  }
}
void print(int x) {
  int l = 1, r = n;
  x++;
  while (l <= r) {
    int m = (l + r) / 2;
    if (getsum(m) >= x)
      r = m - 1;
    else
      l = m + 1;
  }
  printf("%d ", l - 1);
  update(l, -1);
}
int p[200005], q[200005];
int ans[200005];
int main() {
  while (~scanf("%d", &n) && n) {
    read(p);
    read(q);
    for (int i = 0; i < n; i++) ans[i] = p[i] + q[i];
    for (int i = 1; i <= n; i++) {
      ans[i] += ans[i - 1] / i;
      ans[i - 1] %= i;
    }
    initBIT();
    for (int i = n - 1; ~i; i--) print(ans[i]);
    putchar('\n');
  }
  return 0;
}
