#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int A[N], B[N], n, d, BIT[N];
void add(int pos, int val) {
  for (++pos; pos < N; pos += ((pos) & (-(pos)))) BIT[pos] += val;
}
int get(int pos) {
  int s = 0;
  for (++pos; pos > 0; pos -= ((pos) & (-(pos)))) s += BIT[pos];
  return s;
}
int main() {
  ios::sync_with_stdio();
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i], add(i, 1);
  for (int j = 0; j < n; j++) cin >> B[j];
  for (int i = 0; i < n; i++) {
    add(A[i], -1);
    A[i] = get(A[i]);
  }
  memset(BIT, 0, sizeof BIT);
  for (int i = 0; i < n; i++) {
    add(i, 1);
  }
  for (int i = 0; i < n; i++) {
    add(B[i], -1);
    B[i] = get(B[i]);
  }
  for (int i = n - 1; i >= 0; i--) {
    int x = n - i;
    A[i] += B[i] + d;
    d = A[i] / x;
    A[i] %= x;
  }
  memset(BIT, 0, sizeof BIT);
  for (int i = 0; i < n; i++) add(i, 1);
  for (int i = 0; i < n; i++) {
    int l = 0, r = n - 1;
    while (l != r) {
      int m = (l + r) / 2;
      if (get(m) >= A[i] + 1)
        r = m;
      else
        l = m + 1;
    }
    cout << r << ' ';
    add(r, -1);
  }
}
