#include <bits/stdc++.h>
using namespace std;
int a[500000];
int a1[500000];
int b[500000];
int b1[500000];
int stree[1000000];
int sum[1000000];
int n;
void build(int x, int l, int r) {
  if (l == r) {
    stree[x] = 1;
    return;
  }
  int m = (l + r) >> 1;
  build(x << 1, l, m);
  build(x << 1 | 1, m + 1, r);
  stree[x] = stree[x << 1] + stree[x << 1 | 1];
}
int que(int x, int l, int r, int ql, int qr) {
  if (r < ql || l > qr) return 0;
  if (r <= qr && l >= ql) return stree[x];
  int mid = (l + r) >> 1;
  return que(x << 1, l, mid, ql, qr) + que(x << 1 | 1, mid + 1, r, ql, qr);
}
int findx(int x, int l, int r, int v) {
  if (l == r) return l;
  int mid = (l + r) >> 1;
  if (stree[x << 1] >= v)
    return findx(x << 1, l, mid, v);
  else
    return findx(x << 1 | 1, mid + 1, r, v - stree[x << 1]);
}
void update(int x, int l, int r, int tar, int mo) {
  if (r < tar || l > tar) return;
  stree[x] += mo;
  if (l == r) {
    return;
  }
  int mid = (l + r) >> 1;
  update(x << 1, l, mid, tar, mo);
  update(x << 1 | 1, mid + 1, r, tar, mo);
}
int main(int argc, char const *argv[]) {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    a[i] += 1;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &b[i]);
    b[i] += 1;
  }
  build(1, 1, n);
  for (int i = 1; i <= n; i++) {
    a1[i] = que(1, 1, n, 1, a[i]) - 1;
    update(1, 1, n, a[i], -1);
  }
  build(1, 1, n);
  for (int i = 1; i <= n; i++) {
    b1[i] = que(1, 1, n, 1, b[i]) - 1;
    update(1, 1, n, b[i], -1);
  }
  build(1, 1, n);
  for (int i = n; i; i--) {
    a1[i] += b1[i];
    if (a1[i] >= (n - i + 1)) {
      a1[i] %= n - i + 1;
      a1[i - 1]++;
    }
    a1[i]++;
  }
  build(1, 1, n);
  for (int i = 1; i <= n; i++) {
    int t = findx(1, 1, n, a1[i]);
    update(1, 1, n, t, -1);
    printf("%d ", t - 1);
  }
  return 0;
}
