#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int mi(int a, int b) {
  int s = 1;
  for (; b; b >>= 1, a = (long long)a * a % mod)
    if (b & 1) s = (long long)s * a % mod;
  return s;
}
const int N = 200010;
int n, a[N], b[N];
int t[N + 1], p[N + 1];
void upd(int x, int s = 1) {
  for (; x <= N; x += x & -x) t[x] += s;
}
int ask(int x) {
  int s = 0;
  for (; x >= 1; x -= x & -x) s += t[x];
  return s;
}
void ask(int* a) {
  memset(t, 0, sizeof t);
  for (int i = 1; i <= n; ++i) {
    int s = a[i] - ask(a[i]) - 1;
    p[i] += s;
    upd(a[i]);
  }
}
void work() {
  for (int i = n - 1; i >= 1; --i)
    if (p[i] >= n + 1 - i) {
      p[i] -= (n + 1 - i);
      p[i - 1]++;
    }
  p[0] = 0;
  memset(t, 0, sizeof t);
  for (int i = 1; i <= n; ++i) upd(i);
  for (int i = 1; i <= n; ++i) {
    int L = 1, R = n;
    while (L < R) {
      int m = (L + R) >> 1;
      if (ask(m) >= p[i] + 1)
        R = m;
      else
        L = m + 1;
    }
    upd(L, -1);
    printf("%d ", L - 1);
  }
  puts("");
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i], a[i]++;
  for (int i = 1; i <= n; ++i) cin >> b[i], b[i]++;
  ask(a);
  ask(b);
  work();
}
