#include <bits/stdc++.h>
using namespace std;
int p1[200107], p2[200107], p3[200107], c[200107];
int n;
int lowbit(int x) { return x & -x; }
void modify(int x, int val) {
  while (x <= n + 10) {
    c[x] += val;
    x += lowbit(x);
  }
}
int getsum(int x) {
  int res = 0;
  while (x > 0) {
    res += c[x];
    x -= lowbit(x);
  }
  return res;
}
int main() {
  int i, j, x;
  while (scanf("%d", &n) != EOF) {
    memset(c, 0, sizeof(c));
    for (i = 1; i <= n; i++) modify(i, 1);
    for (i = 1; i <= n; i++) {
      scanf("%d", &x);
      x++;
      p1[i] = getsum(x - 1);
      modify(x, -1);
    }
    memset(c, 0, sizeof(c));
    for (i = 1; i <= n; i++) modify(i, 1);
    for (i = 1; i <= n; i++) {
      scanf("%d", &x);
      x++;
      p2[i] = getsum(x - 1);
      modify(x, -1);
    }
    memset(p3, 0, sizeof(p3));
    for (i = n; i >= 1; i--) {
      p3[i] += p1[i] + p2[i];
      if (p3[i] >= (n - i + 1)) {
        p3[i] = p3[i] - (n - i + 1);
        if (i != 1) p3[i - 1]++;
      }
    }
    memset(c, 0, sizeof(c));
    for (i = 1; i <= n; i++) modify(i, 1);
    for (i = 1; i <= n; i++) {
      int low = 1, high = n;
      while (low <= high) {
        int mid = (low + high) / 2;
        if (getsum(mid - 1) > p3[i])
          high = mid - 1;
        else if (getsum(mid - 1) == p3[i] && getsum(mid) - getsum(mid - 1) == 1)
          high = mid - 1;
        else if (getsum(mid - 1) == p3[i] && getsum(mid) - getsum(mid - 1) < 1)
          low = mid + 1;
        else if (getsum(mid - 1) < p3[i])
          low = mid + 1;
      }
      modify(low, -1);
      printf("%d ", low - 1);
    }
    puts("");
  }
  return 0;
}
