#include <bits/stdc++.h>
using namespace std;
const int M = 2e5 + 5;
int sum[M];
int p[M];
int n;
int seg[4 * M];
void build(int l = 0, int r = n, int id = 1) {
  seg[id] = r - l;
  if (r - l <= 1) return;
  int mid = (l + r) / 2;
  build(l, mid, 2 * id);
  build(mid, r, 2 * id + 1);
}
int get(int val, int l = 0, int r = n, int id = 1) {
  seg[id]--;
  if (r - l <= 1) return l;
  int mid = (l + r) / 2;
  if (seg[2 * id] > val) return get(val, l, mid, 2 * id);
  return get(val - seg[2 * id], mid, r, 2 * id + 1);
}
int Get(int val, int l = 0, int r = n, int id = 1) {
  seg[id]++;
  if (r - l <= 1) return 0;
  int mid = (l + r) / 2;
  if (val < mid) return Get(val, l, mid, 2 * id);
  return seg[2 * id] + Get(val, mid, r, 2 * id + 1);
}
void solve() {
  memset(seg, 0, sizeof seg);
  for (int i = 0; i < n; i++) sum[i] += p[i] - Get(p[i]);
}
int32_t main() {
  scanf("%d", &n);
  int t = 2;
  while (t--) {
    for (int i = 0; i < n; i++) scanf("%d", &p[i]);
    solve();
  }
  int sb = 0;
  for (int i = n - 1; ~i; i--) {
    sum[i] += sb;
    int k = sum[i] % (n - i);
    sb = (sum[i] - k) / (n - i);
    sum[i] = k;
  }
  build();
  for (int i = 0; i < n; i++) printf("%d ", get(sum[i]));
  return printf("\n"), 0;
}
