#include <bits/stdc++.h>
using namespace std;
const int maxn = 200001;
bool vis[maxn];
int bit[maxn];
int n, a[maxn], b[maxn];
int oa[maxn], ob[maxn], o[maxn];
int ans[maxn];
int lowbit(int p) { return p & (-p); }
int sum(int p) {
  if (p == 0)
    return 0;
  else
    return bit[p] + sum(p - lowbit(p));
}
void add(int p) {
  if (p > n) return;
  add(p + lowbit(p));
  bit[p]++;
  return;
}
int search(int p) {
  int l = 1, r = n;
  while (l < r) {
    int mid = (l + r) >> 1;
    int now = sum(mid);
    if (mid - now == p && !vis[mid])
      return mid;
    else if (mid - now >= p)
      r = mid - 1;
    else
      l = mid + 1;
  }
  return l;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), a[i]++;
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]), b[i]++;
  memset(bit, 0, sizeof(bit));
  for (int i = 1; i <= n; i++) {
    oa[i] = a[i] - sum(a[i]) - 1;
    add(a[i]);
  }
  memset(bit, 0, sizeof(bit));
  for (int i = 1; i <= n; i++) {
    ob[i] = b[i] - sum(b[i]) - 1;
    add(b[i]);
  }
  memset(o, 0, sizeof(o));
  for (int i = n - 1; i >= 1; i--) {
    o[i] += oa[i] + ob[i];
    if (o[i] >= (n + 1 - i)) {
      o[i] -= n + 1 - i;
      o[i - 1]++;
    }
  }
  for (int i = 1; i <= n; i++) vis[i] = false;
  memset(bit, 0, sizeof(bit));
  for (int i = 1; i <= n; i++) {
    ans[i] = search(o[i] + 1) - 1;
    vis[ans[i] + 1] = true;
    add(ans[i] + 1);
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
