#include <bits/stdc++.h>
using namespace std;
const int SIZE = 200001;
int aFactorSysPerm[SIZE];
int bFactorSysPerm[SIZE];
int resFactorSysPerm[SIZE];
void insertBIT(int n, int x, int val, int BIT[]) {
  while (x < n) {
    BIT[x] += val;
    x += ((x ^ (x + 1)) + 1) / 2;
  }
}
int sumPrefixBIT(int x, int BIT[]) {
  int res = 0;
  while (x >= 0) {
    res += BIT[x];
    x -= ((x ^ (x + 1)) + 1) / 2;
  }
  return res;
}
void getFactorSysPerm(int n, int FactorSysPerm[]) {
  int a;
  int BIT[n];
  fill(BIT, BIT + n, 0);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    FactorSysPerm[i] = a - sumPrefixBIT(a, BIT);
    insertBIT(n, a, 1, BIT);
  }
}
int findOnePermNumber(int n, int x, int FactorSysPermNumber, int BIT[]) {
  int beg = 0;
  int en = n - 1;
  int mid;
  while (beg < en) {
    mid = (beg + en) / 2;
    if (mid - sumPrefixBIT(mid, BIT) >= FactorSysPermNumber)
      en = mid;
    else
      beg = mid + 1;
  }
  return beg;
}
void getPermFromFactorSysPerm(int n, int FactorSysPerm[]) {
  int a;
  int BIT[n];
  fill(BIT, BIT + n, 0);
  for (int i = 0; i < n; i++) {
    a = findOnePermNumber(n, i, FactorSysPerm[i], BIT);
    insertBIT(n, a, 1, BIT);
    printf("%d ", a);
  }
}
void getSumPerm(int n, int aFactorSysPerm[], int bFactorSysPerm[],
                int resFactorSysPerm[]) {
  fill(resFactorSysPerm, resFactorSysPerm + n, 0);
  for (int i = n - 1; i >= 0; i--) {
    resFactorSysPerm[i] += aFactorSysPerm[i] + bFactorSysPerm[i];
    while (resFactorSysPerm[i] > n - i - 1) {
      if (i > 0) {
        resFactorSysPerm[i - 1] += 1;
      }
      resFactorSysPerm[i] -= (n - i);
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  getFactorSysPerm(n, aFactorSysPerm);
  getFactorSysPerm(n, bFactorSysPerm);
  getSumPerm(n, aFactorSysPerm, bFactorSysPerm, resFactorSysPerm);
  getPermFromFactorSysPerm(n, resFactorSysPerm);
  return 0;
}
