#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 2e5 + 10, INF = 1e9 + 7;
long long n, s[4 * MAXN], a[MAXN], b[MAXN], ans[MAXN], tmp[2][MAXN],
    FactBase[MAXN], f[2 * MAXN];
inline void add(long long x) {
  x++;
  while (x < MAXN) f[x]++, x += (x & -x);
}
inline long long Get(long long x) {
  long long ret = 0;
  x++;
  while (x > 0) ret += f[x], x -= (x & -x);
  return ret;
}
inline void Convert() {
  for (long long i = 0; i < n; i++) {
    tmp[0][i] = a[i] - Get(a[i]);
    add(a[i]);
  }
  memset(f, 0, sizeof(f));
  for (long long i = 0; i < n; i++) {
    tmp[1][i] = b[i] - Get(b[i]);
    add(b[i]);
  }
  long long addition = 0;
  for (long long i = n - 1; i >= 0; i--) {
    FactBase[i] = (tmp[0][i] + tmp[1][i] + addition) % (n - i);
    addition = (tmp[0][i] + tmp[1][i] + addition) / (n - i);
  }
}
inline void Delete(long long p, long long id = 1, long long l = 0,
                   long long r = n) {
  if (r - l < 2) {
    s[id] = 0;
    return;
  }
  if (p < ((l + r) >> 1))
    Delete(p, (id << 1), l, ((l + r) >> 1));
  else
    Delete(p, (id << 1) + 1, ((l + r) >> 1), r);
  s[id] = s[(id << 1)] + s[(id << 1) + 1];
}
inline long long Get_P_TH(long long p, long long id = 1, long long l = 0,
                          long long r = n) {
  if (r - l < 2) return l;
  if (p < s[(id << 1)])
    return Get_P_TH(p, (id << 1), l, ((l + r) >> 1));
  else
    return Get_P_TH(p - s[(id << 1)], (id << 1) + 1, ((l + r) >> 1), r);
}
inline void Build(long long id = 1, long long l = 0, long long r = n) {
  if (r - l < 2) {
    s[id] = 1;
    return;
  }
  Build((id << 1), l, ((l + r) >> 1)), Build((id << 1) + 1, ((l + r) >> 1), r);
  s[id] = s[(id << 1)] + s[(id << 1) + 1];
}
inline void Solve() {
  Build();
  for (long long i = 0; i < n; i++) {
    ans[i] = Get_P_TH(FactBase[i]);
    Delete(ans[i]);
  }
  for (long long i = 0; i < n; i++) cout << ans[i] << ' ';
}
int32_t main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n; i++) cin >> b[i];
  Convert();
  Solve();
}
