#include <bits/stdc++.h>
using namespace std;
int n;
const int size = 200010;
int a[size], b[size];
int p[size], q[size], pq[size], res[size];
int tree[size];
int lowBit(int x) { return x & -x; }
void add(int x) {
  for (x++; x < size; x += lowBit(x)) {
    tree[x]++;
  }
}
int get(int x) {
  int ans = 0;
  for (; x; x -= lowBit(x)) {
    ans += tree[x];
  }
  return ans;
}
void solve() {
  int L, R, M;
  for (int i = 0; i < n; i++) {
    p[i] = a[i] - get(a[i]);
    add(a[i]);
  }
  memset(tree, 0, sizeof(tree));
  for (int i = 0; i < n; i++) {
    q[i] = b[i] - get(b[i]);
    add(b[i]);
  }
  for (int i = 0; i < n; i++) {
    pq[i] = p[i] + q[i];
  }
  for (int i = n - 1; i > 0; i--) {
    pq[i - 1] += pq[i] / (n - i);
    pq[i] %= (n - i);
  }
  pq[0] %= n;
  memset(tree, 0, sizeof(tree));
  for (int i = 0; i < n; i++) {
    L = 0, R = n;
    while (R - L > 1) {
      M = (R + L) >> 1;
      if (M - get(M) <= pq[i]) {
        L = M;
      } else {
        R = M;
      }
    }
    res[i] = L;
    add(L);
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  solve();
  for (int i = 0; i < n - 1; i++) {
    cout << res[i] << " ";
  }
  cout << res[n - 1] << endl;
  return 0;
}
