#include <bits/stdc++.h>
using namespace std;
int fact(int num) { return (num == 1 || num == 0) ? 1 : num * fact(num - 1); }
bool* used;
int* ans;
int* tree;
void divide(int n) {
  for (int i = 0, t = 0; i < n; ++i) {
    ans[(n - 1) - i] += t;
    t = ans[(n - 1) - i] / (i + 1);
    ans[(n - 1) - i] %= (i + 1);
  }
}
void add(int index, int val, int n) {
  for (int i = index; i < n; i = (i | (i + 1))) {
    if (index < 0) {
      int f = 0;
      f++;
    }
    tree[i] += val;
  }
}
int getSum(int index) {
  if (index == -1) return 0;
  int res = 0;
  for (int i = index; i >= 0; i = (i & (i + 1)) - 1) {
    res += tree[i];
  }
  return res;
}
int nextNumb(int index, int n) {
  int k = 0;
  int l = 0, r = n - 1;
  int mid;
  int res;
  while (l <= r) {
    mid = (l + r) / 2;
    if (getSum(mid) > index) {
      res = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  return res;
}
int main() {
  int n;
  int* p;
  int* q;
  cin >> n;
  p = new int[n];
  q = new int[n];
  ans = new int[n];
  tree = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    tree[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    cin >> q[i];
    add(i, 1, n);
  }
  for (int i = 0; i < n; i++) {
    int t = q[i];
    q[i] = getSum(q[i] - 1);
    add(t, -1, n);
  }
  for (int i = 0; i < n; i++) tree[i] = 0;
  for (int i = 0; i < n; i++) add(i, 1, n);
  for (int i = 0; i < n; i++) {
    int t = p[i];
    p[i] = getSum(p[i] - 1);
    add(t, -1, n);
  }
  for (int i = 0; i < n; i++) tree[i] = 0;
  for (int i = 0; i < n; i++) {
    ans[i] = q[i] + p[i];
    add(i, 1, n);
  }
  divide(n);
  for (int i = 0; i < n; i++) {
    ans[i] = nextNumb(ans[i], n);
    add(ans[i], -1, n);
    cout << ans[i] << " ";
  }
  return 0;
}
