#include <bits/stdc++.h>
using namespace std;
int segTree[1000000];
void init(int node, int l, int r) {
  if (l == r) {
    segTree[node] = 1;
    return;
  }
  int m = (l + r) / 2;
  init(2 * node, l, m);
  init(2 * node + 1, m + 1, r);
  segTree[node] = segTree[2 * node] + segTree[2 * node + 1];
}
void del(int idx, int node, int l, int r) {
  if (l > idx || r < idx) return;
  if (l == idx && r == idx) {
    segTree[node] = 0;
    return;
  }
  int m = (l + r) / 2;
  del(idx, 2 * node, l, m);
  del(idx, 2 * node + 1, m + 1, r);
  segTree[node] = segTree[2 * node] + segTree[2 * node + 1];
}
int query(int s, int e, int node, int l, int r) {
  if (l > e || r < s) return -1;
  if (s <= l && e >= r) return segTree[node];
  int m = (l + r) / 2;
  int left = query(s, e, 2 * node, l, m);
  int right = query(s, e, 2 * node + 1, m + 1, r);
  if (left == -1) return right;
  if (right == -1) return left;
  return left + right;
}
int permut(int idx, int node, int l, int r) {
  if (l == r) return l;
  int m = (l + r) / 2;
  int left = segTree[2 * node];
  if (idx > left)
    return permut(idx - left, 2 * node + 1, m + 1, r);
  else
    return permut(idx, 2 * node, l, m);
}
int main() {
  int n;
  cin >> n;
  int a[n], b[n], orda[n], ordb[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  init(1, 0, n - 1);
  for (int i = 0; i < n; i++) {
    orda[i] = query(0, a[i], 1, 0, n - 1) - 1;
    del(a[i], 1, 0, n - 1);
  }
  init(1, 0, n - 1);
  for (int i = 0; i < n; i++) {
    ordb[i] = query(0, b[i], 1, 0, n - 1) - 1;
    del(b[i], 1, 0, n - 1);
  }
  for (int i = n - 1; i >= 0; i--) {
    int tmp = orda[i] + ordb[i];
    orda[i] = tmp % (n - i);
    if (i > 0) orda[i - 1] = orda[i - 1] + tmp / (n - i);
  }
  init(1, 0, n - 1);
  for (int i = 0; i < n; i++) {
    int ans = permut(orda[i] + 1, 1, 0, n - 1);
    cout << ans << " ";
    del(ans, 1, 0, n - 1);
  }
  return 0;
}
