#include <bits/stdc++.h>
using namespace std;
int n;
int a[200005];
int b[200005];
int p[200005];
int q[200005];
int r[200005];
int fen[200005];
void update(int id, int val) {
  for (int i = id; i <= n; i += i & -i) {
    fen[i] += val;
  }
}
int query(int id) {
  int res = 0;
  for (int i = id; i > 0; i -= i & -i) {
    res += fen[i];
  }
  return res;
}
void build(int x[], int y[]) {
  memset(fen, 0, sizeof(fen));
  for (int i = 1; i <= n; i++) {
    update(i, 1);
  }
  for (int i = 0; i < n; i++) {
    y[i] = query(x[i] - 1);
    update(x[i], -1);
  }
}
void retrieve(int x[]) {
  memset(fen, 0, sizeof(fen));
  for (int i = 1; i <= n; i++) {
    update(i, 1);
  }
  for (int i = 0; i < n; i++) {
    int lo = 1, hi = n, mid;
    while (lo < hi) {
      mid = (lo + hi) >> 1;
      if (query(mid) < x[i] + 1)
        lo = mid + 1;
      else
        hi = mid;
    }
    update(lo, -1);
    x[i] = lo;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i]++;
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    b[i]++;
  }
  build(a, p);
  build(b, q);
  for (int i = n - 1, carry = 0; i >= 0; i--) {
    int res = p[i] + q[i] + carry;
    carry = 0;
    if (res >= n - i) {
      carry = 1;
      res -= n - i;
    }
    r[i] = res;
  }
  retrieve(r);
  for (int i = 0; i < n; i++) {
    cout << r[i] - 1 << " ";
  }
  cout << "\n";
  return 0;
}
