#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int n, a[maxn], b[maxn];
int sa[maxn], sb[maxn], bit[maxn];
inline void add(int x, int v) {
  for (; x <= n; x += x & -x) bit[x] += v;
}
inline int read(int x) {
  int res = 0;
  for (; x; x ^= x & -x) res += bit[x];
  return res;
}
inline int findkth(int k) {
  int idx = 0;
  for (int i = 20; i >= 0; --i) {
    idx ^= 1 << i;
    if (idx <= n && bit[idx] < k)
      k -= bit[idx];
    else
      idx ^= 1 << i;
  }
  return idx + 1;
}
int main() {
  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 = 1; i <= n; ++i) add(i, 1);
  for (int i = 0; i < n; ++i) {
    sa[i] = read(a[i]);
    add(a[i] + 1, -1);
  }
  for (int i = 1; i <= n; ++i) add(i, 1);
  for (int i = 0; i < n; ++i) {
    sb[i] = read(b[i]);
    add(b[i] + 1, -1);
  }
  int c = 0;
  for (int i = n - 1; i >= 0; --i) {
    sa[i] += sb[i] + c;
    c = sa[i] / (n - i);
    sa[i] %= n - i;
  }
  for (int i = 1; i <= n; ++i) add(i, 1);
  for (int i = 0; i < n; ++i) {
    int v = findkth(sa[i] + 1);
    printf("%d ", v - 1);
    add(v, -1);
  }
  return 0;
}
