#include <bits/stdc++.h>
const long long inf64 = 0x3fffffff * (long long)0x3fffffff;
using namespace std;
int n;
int a[210000], b[210000];
int ans[210000];
int c[210000];
int dp[210000];
int lowbit(int x) { return x & (-x); }
void modify(int x, int y) {
  for (int i = x; i <= n; i += lowbit(i)) {
    c[i] += y;
  }
}
int getsum(int x) {
  int sum = 0;
  for (int i = x; i >= 1; i -= lowbit(i)) sum += c[i];
  return sum;
}
int main() {
  int i;
  while (scanf("%d", &n) != EOF) {
    for (i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
    }
    for (i = 1; i <= n; i++) {
      scanf("%d", &b[i]);
    }
    int ix;
    memset(c, 0, sizeof(c));
    for (i = 1; i <= n; i++) {
      ix = getsum(a[i]);
      modify(a[i] + 1, 1);
      a[i] = a[i] - ix;
    }
    memset(c, 0, sizeof(c));
    for (i = 1; i <= n; i++) {
      ix = getsum(b[i]);
      modify(b[i] + 1, 1);
      b[i] = b[i] - ix;
    }
    ix = 0;
    for (i = n; i >= 1; i--) {
      ans[i] = (a[i] + b[i] + ix) % (n - i + 1);
      ix = (a[i] + b[i] + ix) / (n - i + 1);
    }
    for (i = 1; i <= n + 1; i++) dp[i] = i;
    memset(c, 0, sizeof(c));
    int l, r, mid;
    for (i = 1; i <= n; i++) {
      l = 1, r = n;
      while (l < r) {
        mid = (l + r) / 2;
        if (mid - getsum(mid) < ans[i] + 1)
          l = mid + 1;
        else
          r = mid;
      }
      ans[i] = l;
      modify(l, 1);
    }
    for (i = 1; i <= n; i++) {
      printf("%d%c", ans[i] - 1, i == n ? '\n' : ' ');
    }
  }
  return 0;
}
