#include <bits/stdc++.h>
using namespace std;
const int N = 200000;
vector<int> BIT(N + 1, 0);
void update(int x, int val) {
  while (x <= N) {
    BIT[x] += val;
    x += x & -x;
  }
}
int query(int x) {
  int ans = 0;
  while (x > 0) {
    ans += BIT[x];
    x -= x & -x;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n, i, l, r, mid;
  cin >> n;
  vector<int> A(n);
  vector<int> B(n);
  vector<int> factoradic(n, 0);
  fill(BIT.begin(), BIT.end(), 0);
  for (i = 1; i <= n; i++) update(i, 1);
  for (i = 0; i < n; i++) {
    cin >> A[i];
    update(A[i] + 1, -1);
    A[i] = query(A[i]);
  }
  fill(BIT.begin(), BIT.end(), 0);
  for (i = 1; i <= n; i++) update(i, 1);
  for (i = 0; i < n; i++) {
    cin >> B[i];
    update(B[i] + 1, -1);
    B[i] = query(B[i]);
  }
  for (i = n - 1; i >= 1; i--) {
    factoradic[i] += A[i] + B[i];
    factoradic[i - 1] = factoradic[i] / (n - i);
    factoradic[i] %= (n - i);
  }
  factoradic[0] += A[0] + B[0];
  factoradic[0] %= n;
  fill(BIT.begin(), BIT.end(), 0);
  for (i = 1; i <= n; i++) update(i, 1);
  for (i = 0; i < n; i++) {
    l = 0, r = n;
    while (l < r) {
      mid = l + (r - l + 1) / 2;
      if (query(mid) < factoradic[i] + 1)
        l = mid;
      else
        r = mid - 1;
    }
    update(l + 1, -1);
    cout << l << " ";
  }
  return 0;
}
