#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
int fen[MAXN], a[MAXN], b[MAXN], x[MAXN], m[4 * MAXN];
int n;
void add(int x) {
  for (; x < MAXN; x += x & (-x)) fen[x]++;
}
int get(int x) {
  int ans = 0;
  for (; x; x -= x & (-x)) ans += fen[x];
  return ans;
}
void addi(int p, int x = 1, int l = 0, int r = n) {
  if (l == r - 1) {
    m[x] = 1;
    return;
  }
  int mid = (l + r) / 2;
  if (p < mid)
    addi(p, 2 * x, l, mid);
  else
    addi(p, 2 * x + 1, mid, r);
  m[x] = m[2 * x] + m[2 * x + 1];
}
int geti(int p, int x = 1, int l = 0, int r = n) {
  if (p == 1 && l == r - 1) return l;
  int mid = (l + r) / 2;
  int s1 = mid - l, s2 = r - mid;
  if (p <= s1 - m[2 * x])
    return geti(p, 2 * x, l, mid);
  else
    return geti(p - (s1 - m[2 * x]), 2 * x + 1, mid, r);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i]++;
    x[i] = a[i] - get(a[i]);
    add(a[i]);
  }
  fill(fen, fen + MAXN, 0);
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    b[i]++;
    x[i] += b[i] - get(b[i]);
    add(b[i]);
  }
  for (int i = n - 1; i >= 0; i--) {
    x[i] -= 2;
    if (x[i] >= n - i) {
      x[i] -= n - i;
      if (i - 1 >= 0) x[i - 1]++;
    }
  }
  fill(fen, fen + MAXN, 0);
  for (int i = 0; i < n; i++) {
    int t = geti(x[i] + 1);
    addi(t);
    cout << t << ' ';
  }
  cout << endl;
  return 0;
}
