#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using ll = long long;
using ld = long double;
int const N = 2e5 + 20;
int n, a[N], b[N], ta[N], tb[N], c[N];
int fen[N];
inline void add(int p) {
  for (p++; p < N; p += p & -p) fen[p]++;
}
inline int get(int p) {
  int res = 0;
  for (; p; p -= p & -p) res += fen[p];
  return res;
}
inline void build_from(int ta[N], int a[N]) {
  memset(fen, 0, sizeof fen);
  for (int i = 0; i < n; i++) {
    ta[i] = a[i] - get(a[i]);
    add(a[i]);
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  build_from(ta, a);
  build_from(tb, b);
  for (int i = n - 1; i >= 0; i--) {
    ta[i] += tb[i];
    if (i) ta[i - 1] += ta[i] / (n - i);
    ta[i] %= (n - i);
  }
  memset(fen, 0, sizeof fen);
  for (int i = 0; i < n; i++) {
    int x = 0;
    for (int j = 22; ~j; j--)
      if (x + (1 << j) < n && (1 << j) - fen[x + (1 << j)] <= ta[i])
        ta[i] -= (1 << j) - fen[x += (1 << j)];
    c[i] = x;
    add(c[i]);
  }
  for (int i = 0; i < n; i++) cout << c[i] << ' ';
  cout << '\n';
}
