#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
int fw[N];
int n;
int get(int r) {
  int result = 0;
  for (; r >= 0; r = (r & (r + 1)) - 1) result += fw[r];
  return result;
}
void upd(int i, int delta) {
  for (; i < n; i = (i | (i + 1))) fw[i] += delta;
}
int get(int l, int r) {
  if (!l) return get(r);
  return get(r) - get(l - 1);
}
vector<int> ord(vector<int> p) {
  memset((fw), 0, sizeof(fw));
  vector<int> res(n, 0);
  for (int i = 0; i < n; i++) {
    res[i] = p[i] - get(p[i]);
    upd(p[i], 1);
  }
  return res;
}
int main() {
  scanf("%d", &n);
  vector<int> p1(n);
  vector<int> p2(n);
  for (int i = 0; i < n; i++) scanf("%d", &p1[i]);
  for (int i = 0; i < n; i++) scanf("%d", &p2[i]);
  vector<int> f1 = ord(p1);
  vector<int> f2 = ord(p2);
  vector<int> res = f1;
  int maximum = 0;
  for (int i = res.size() - 1; i >= 0; i--) {
    res[i] += f2[i];
    if (res[i] > maximum) {
      if (i) {
        res[i - 1]++;
      }
      res[i] -= maximum + 1;
    }
    maximum++;
  }
  for (int i = 0; i < N; i++) fw[i] = 0;
  vector<int> ans(n);
  for (int i = 0; i < n; i++) {
    int l = -1, r = n;
    while (r - l > 1) {
      int m = (l + r) / 2;
      int good_count = m - get(m);
      if (good_count >= res[i])
        r = m;
      else
        l = m;
    }
    if (l - get(l) != res[i]) l++;
    ans[i] = l;
    upd(l, 1);
  }
  for (int i = 0; i < n; i++) printf("%d ", (int)(ans[i]));
  return 0;
}
