#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
int a[200010], b[200010], B[200010];
void update(int u, int first) {
  for (; u < 200010; u += u & -u) B[u] += first;
}
int calc(int u, int ans = 0) {
  for (; u; u -= u & -u) ans += B[u];
  return ans;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 0; i < n; i++) scanf("%d", b + i);
  for (int i = n; i--;) {
    update(a[i] + 1, 1);
    a[i] = calc(a[i]);
  }
  memset(B, 0, sizeof B);
  for (int i = n; i--;) {
    update(b[i] + 1, 1);
    b[i] = calc(b[i]);
  }
  for (int i = n; i--;) {
    a[i] += b[i];
    if (i) a[i - 1] += a[i] / (n - i);
    a[i] %= n - i;
  }
  for (int i = 0; i < n; i++) {
    a[i]++;
    int st = 0, ed = n;
    while (st + 1 < ed) {
      int md = st + ed >> 1;
      if (calc(md) < a[i])
        st = md;
      else
        ed = md;
    }
    smin(ed, n);
    a[i] = ed - 1;
    update(ed, -1);
  }
  for (int i = 0; i < n; i++) printf("%d ", a[i]);
}
