#include <bits/stdc++.h>
using namespace std;
int n, p1[262144], p2[262144], conv1[262144], conv2[262144], sum[262144],
    ret[262144];
int build(int st[], int node, int low, int high) {
  if (low == high) {
    st[node] = 1;
    return 1;
  }
  st[node] = build(st, 2 * node + 1, low, (low + high) / 2) +
             build(st, 2 * node + 2, (low + high) / 2 + 1, high);
  return st[node];
}
void update(int st[], int node, int low, int high, int ind) {
  if (low > ind || high < ind) return;
  if (low == high) {
    st[node] = 0;
    return;
  }
  update(st, 2 * node + 1, low, (low + high) / 2, ind);
  update(st, 2 * node + 2, (low + high) / 2 + 1, high, ind);
  st[node] = st[2 * node + 1] + st[2 * node + 2];
}
int query(int st[], int node, int low, int high, int ql, int qr) {
  if (low > qr || high < ql) return 0;
  if (ql <= low && high <= qr) return st[node];
  return query(st, 2 * node + 1, low, (low + high) / 2, ql, qr) +
         query(st, 2 * node + 2, (low + high) / 2 + 1, high, ql, qr);
}
int find(int st[], int node, int low, int high, int val, int tot) {
  if (low == high) return low;
  if (tot - st[2 * node + 2] >= val)
    return find(st, 2 * node + 1, low, (low + high) / 2, val,
                tot - st[2 * node + 2]);
  return find(st, 2 * node + 2, (low + high) / 2 + 1, high, val, tot);
}
int find(int st[], int val) { return find(st, 0, 0, n - 1, val, st[0]); }
void conv(int p[], int store[]) {
  int st[262144 * 2];
  build(st, 0, 0, n - 1);
  for (int i = 0; i < n; i++) {
    store[i] = query(st, 0, 0, n - 1, 0, p[i]) - 1;
    update(st, 0, 0, n - 1, p[i]);
  }
}
void add(int arr1[], int arr2[], int store[]) {
  int highest, carry = 0;
  for (int i = n - 1; i >= 0; i--) {
    highest = n - i;
    store[i] = arr1[i] + arr2[i] + carry;
    carry = 0;
    if (store[i] >= highest) {
      store[i] -= highest;
      carry = 1;
    }
  }
}
void back(int arr[], int store[]) {
  int st[2 * 262144];
  build(st, 0, 0, n - 1);
  for (int i = 0; i < n; i++) {
    store[i] = find(st, arr[i] + 1);
    update(st, 0, 0, n - 1, store[i]);
  }
}
int main(void) {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> p1[i];
  for (int i = 0; i < n; i++) cin >> p2[i];
  conv(p1, conv1);
  conv(p2, conv2);
  add(conv1, conv2, sum);
  back(sum, ret);
  for (int i = 0; i < n - 1; i++) cout << ret[i] << " ";
  cout << ret[n - 1];
  puts("");
  return 0;
}
