#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
int n;
struct BIT {
  int dat[maxn];
  void clear() { memset(dat, 0, sizeof(dat)); }
  int lowbit(int x) { return -x & x; }
  int getSum(int x) {
    int sum = 0;
    while (x > 0) {
      sum += dat[x];
      x -= lowbit(x);
    }
    return sum;
  }
  void add(int x, int val) {
    while (x <= n) {
      dat[x] += val;
      x += lowbit(x);
    }
  }
};
int a[maxn], b[maxn];
int v[maxn];
BIT bit;
void kuangtuo(int *arr, BIT &bit) {
  bit.clear();
  for (int i = 1; i <= n; ++i) {
    int s = arr[i] - 1 - bit.getSum(arr[i] - 1);
    bit.add(arr[i], 1);
    v[i] += s;
  }
}
int c[maxn];
int Bsearch(int low, int high, int K) {
  int mid = low + (high - low) / 2;
  while (low < high) {
    if ((mid - bit.getSum(mid)) >= K)
      high = mid;
    else
      low = mid + 1;
    mid = low + (high - low) / 2;
  }
  return mid;
}
void nikuangtuo(int *arr, BIT &bit) {
  bit.clear();
  for (int i = 1; i <= n; ++i) {
    int p = Bsearch(1, n, (v[i] + 1));
    arr[i] = p;
    bit.add(p, 1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    int x;
    scanf("%d", &x);
    a[i] = x + 1;
  }
  for (int i = 1; i <= n; ++i) {
    int x;
    scanf("%d", &x);
    b[i] = x + 1;
  }
  kuangtuo(a, bit);
  kuangtuo(b, bit);
  for (int i = n; i >= 1; --i) {
    int j = n - i + 1;
    v[i - 1] += v[i] / j;
    v[i] = v[i] % j;
  }
  nikuangtuo(c, bit);
  for (int i = 1; i <= n; ++i) {
    if (i != 1) printf(" ");
    printf("%d", c[i] - 1);
  }
  printf("\n");
  return 0;
}
