#include <bits/stdc++.h>
using namespace std;
const int Maxn = 200010, Mo = 51061, INF = INT_MAX >> 2;
int N, M, a[Maxn], b[Maxn], c[Maxn], cnt[Maxn];
int t[Maxn], g[Maxn * 3], ans[Maxn];
int ask(int x) {
  int ans = 0;
  for (int i = x; i; i ^= i & -i) ans += t[i];
  return ans;
}
void ins(int x) {
  for (int i = x; i <= N; i += i & -i) t[i]++;
}
void ins(int k, int l, int r, int x, int key) {
  if (x < l || x > r) return;
  if (l == r) {
    g[k] = key;
    return;
  }
  int mid = (l + r) >> 1;
  ins(k * 2, l, mid, x, key);
  ins(k * 2 + 1, mid + 1, r, x, key);
  g[k] = g[k * 2] + g[k * 2 + 1];
}
int ask(int k, int l, int r, int key) {
  if (l == r) return l;
  int mid = (l + r) >> 1;
  if (key <= g[k * 2])
    return ask(k * 2, l, mid, key);
  else
    return ask(k * 2 + 1, mid + 1, r, key - g[k * 2]);
}
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]++;
  reverse(a + 1, a + N + 1);
  reverse(b + 1, b + N + 1);
  for (int i = 1; i <= N; i++) cnt[i] = ask(a[i]), ins(a[i]);
  for (int i = 1; i <= N; i++) a[i] = cnt[i];
  memset(t, 0, sizeof(t));
  for (int i = 1; i <= N; i++) cnt[i] = ask(b[i]), ins(b[i]);
  for (int i = 1; i <= N; i++) b[i] = cnt[i];
  for (int i = 1; i <= N; i++) c[i] = a[i] + b[i];
  for (int i = 1; i <= N; i++)
    if (c[i] >= i) c[i + 1]++, c[i] -= i;
  for (int i = 1; i <= N; i++) ins(1, 1, N, i, 1);
  for (int i = N; i >= 1; i--) {
    ans[i] = ask(1, 1, N, c[i] + 1);
    ins(1, 1, N, ans[i], 0);
  }
  reverse(ans + 1, ans + N + 1);
  for (int i = 1; i < N; i++) cout << ans[i] - 1 << " ";
  cout << ans[N] - 1 << endl;
  return 0;
}
