#include <bits/stdc++.h>
using namespace std;
struct node {
  int value, cnt;
};
node tree[1000000];
void tinit(int id, int first, int last) {
  tree[id].cnt = last - first + 1;
  tree[id].value = first;
  if (last != first) {
    int mid = (first + last) / 2;
    tinit(id * 2, first, mid);
    tinit(id * 2 + 1, mid + 1, last);
  }
}
void update_child(int id) {
  tree[id].cnt = tree[id * 2].cnt + tree[id * 2 + 1].cnt;
  if (tree[id * 2].cnt <= 0)
    tree[id].value = tree[id * 2 + 1].value;
  else if (tree[id * 2 + 1].cnt <= 0)
    tree[id].value = tree[id * 2].value;
  else
    tree[id].value = min(tree[id * 2].value, tree[id * 2 + 1].value);
}
int sub(int id, int num) {
  if (tree[id].cnt == 1) {
    tree[id].cnt--;
    return tree[id].value;
  }
  int res;
  if (num < tree[id * 2].cnt)
    res = sub(id * 2, num);
  else
    res = sub(id * 2 + 1, num - tree[id * 2].cnt);
  update_child(id);
  return res;
}
int subx(int id, int l, int r, int x) {
  if (l == r) {
    tree[id].cnt--;
    return 0;
  }
  int mid = (l + r) / 2, res;
  if (x <= mid)
    res = subx(id * 2, l, mid, x);
  else
    res = subx(id * 2 + 1, mid + 1, r, x) + tree[id * 2].cnt;
  update_child(id);
  return res;
}
void solve() {
  int n;
  scanf("%d", &n);
  vector<int> pe(n), qe(n), re(n);
  tinit(1, 0, n - 1);
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    pe[i] = subx(1, 0, n - 1, x);
  }
  tinit(1, 0, n - 1);
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    qe[i] = subx(1, 0, n - 1, x);
  }
  int os = 0;
  for (int i = 0; i < n; ++i) {
    int j = n - 1 - i;
    int s = pe[j] + qe[j] + os;
    re[j] = s % (i + 1);
    os = s / (i + 1);
  }
  tinit(1, 0, n - 1);
  for (int i = 0; i < n; ++i) printf("%d ", sub(1, re[i]));
  printf("\n");
}
int main() { solve(); }
