#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const long long mod = 1e9 + 7;
int n, a[maxn], b[maxn], c[maxn], tr[maxn * 4];
void build(int num, int l, int r) {
  tr[num] = r - l + 1;
  if (l == r) return;
  int mid = (l + r) / 2;
  build(num * 2, l, mid);
  build(num * 2 + 1, mid + 1, r);
}
void putin(int num, int l, int r, int x) {
  if (l == r) {
    tr[num]--;
    return;
  }
  int mid = (l + r) / 2;
  if (x <= mid) putin(num * 2, l, mid, x);
  if (x >= mid + 1) putin(num * 2 + 1, mid + 1, r, x);
  tr[num] = tr[num * 2] + tr[num * 2 + 1];
}
int getout(int num, int l, int r, int x) {
  if (x < l) return 0;
  if (l == r) return tr[num];
  int mid = (l + r) / 2;
  if (x <= mid) return getout(num * 2, l, mid, x);
  if (x < r) return tr[num * 2] + getout(num * 2 + 1, mid + 1, r, x);
  return tr[num];
}
int findout(int num, int l, int r, int x) {
  if (l == r) return l;
  int mid = (l + r) / 2;
  if (tr[num * 2] >= x)
    return findout(num * 2, l, mid, x);
  else
    return findout(num * 2 + 1, mid + 1, r, x - tr[num * 2]);
}
int main() {
  int i, j;
  cin >> n;
  build(1, 1, n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &j);
    j++;
    putin(1, 1, n, j);
    a[i] = getout(1, 1, n, j - 1);
  }
  build(1, 1, n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &j);
    j++;
    putin(1, 1, n, j);
    b[i] = getout(1, 1, n, j - 1);
  }
  for (i = n; i >= 1; i--) {
    c[i] += a[i] + b[i];
    while (c[i] >= n + 1 - i) {
      c[i] -= n + 1 - i;
      c[i - 1]++;
    }
  }
  build(1, 1, n);
  for (i = 1; i <= n; i++) {
    c[i] = findout(1, 1, n, c[i] + 1);
    putin(1, 1, n, c[i]);
    printf("%d ", c[i] - 1);
  }
  cout << "\n";
  return 0;
}
