#include <bits/stdc++.h>
using namespace std;
int n;
int A[200010], B[200010], A_fact[200010], B_fact[200010], sum_fact[200010];
class FenwickTree {
 private:
  int N, iBM;
  vector<int> tree;

 public:
  FenwickTree(int n) : N(n), iBM(1) {
    while (iBM < n) iBM *= 2;
    tree.assign(iBM + 1, 0);
  }
  void update(int idx, int val) {
    while (idx <= iBM) {
      tree[idx] += val;
      idx += (idx & -idx);
    }
  }
  int query(int idx) {
    int sum = 0;
    while (idx) {
      sum += tree[idx];
      idx -= (idx & -idx);
    }
    return sum;
  }
  int getidx(int freq) {
    int idx = 0, mask = iBM;
    while (mask && idx < N) {
      int t = idx + mask;
      if (freq >= tree[t]) {
        idx = t;
        freq -= tree[t];
      }
      mask >>= 1;
    }
    if (freq != 0)
      return -1;
    else
      return min(N, idx + 1);
  }
  void reset(void) { tree.assign(iBM + 1, 0); }
};
int main() {
  std::ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i];
  for (int i = 0; i < n; i++) cin >> B[i];
  FenwickTree ft(n);
  for (int i = 1; i < n; i++) {
    ft.update(i + 1, 1);
  }
  for (int i = 0; i < n; i++) {
    A_fact[i] = ft.query(A[i] + 1);
    ft.update(A[i] + 1, -1);
  }
  ft.reset();
  for (int i = 1; i < n; i++) {
    ft.update(i + 1, 1);
  }
  for (int i = 0; i < n; i++) {
    B_fact[i] = ft.query(B[i] + 1);
    ft.update(B[i] + 1, -1);
  }
  int carry = 0;
  for (int i = n - 1; i >= 0; i--) {
    int t = A_fact[i] + B_fact[i] + carry;
    int j = n - i;
    sum_fact[i] = t % j;
    carry = t / j;
  }
  ft.reset();
  for (int i = 0; i < n; i++) {
    ft.update(i + 1, 1);
  }
  for (int i = 0; i < n; i++) {
    int id = ft.getidx(sum_fact[i]);
    cout << id - 1 << " ";
    ft.update(id, -1);
  }
  return 0;
}
