#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000000,100000000000")
using namespace std;
const double eps = 1E-9;
const double Exp = 2.718281828459045;
const double Pi = 3.1415926535897932;
const int NMAX = 200000 + 5;
const int MMAX = 100000 + 5;
const int INF = 1000000000;
const int BS = 1000000007;
template <typename T>
inline T abs(const T a) {
  if (a < 0) return -a;
  return a;
}
template <typename T>
inline T sqr(const T& a) {
  return a * a;
}
int t[NMAX];
int a[NMAX];
int sum[NMAX];
void modify(int x, int d) {
  for (; x < NMAX; x |= (x + 1)) t[x] += d;
}
int get(int x) {
  int res = 0;
  for (; x >= 0; x = (x & (x + 1)) - 1) res += t[x];
  return res;
}
int main() {
  int n, i;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++) {
    sum[i] = a[i] - get(a[i]);
    modify(a[i], 1);
  }
  memset(t, 0, sizeof(t));
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++) {
    sum[i] += a[i] - get(a[i]);
    modify(a[i], 1);
  }
  memset(t, 0, sizeof(t));
  set<int> st;
  set<int>::iterator it;
  for (i = 0; i < n; i++) st.insert(i);
  int d = 0;
  for (i = n - 1; i >= 0; i--) {
    sum[i] += d;
    d = sum[i] / (n - i);
    sum[i] = sum[i] % (n - i);
  }
  int l, r, m;
  for (i = 0; i < n; i++) {
    l = 0;
    r = n - 1;
    while (l < r) {
      m = (l + r + 1) >> 1;
      if (m - get(m) <= sum[i])
        l = m;
      else
        r = m - 1;
    }
    it = st.lower_bound(l);
    if (it != st.end()) {
      l = *it;
      if (l - get(l) != sum[i]) l = *(--it);
    } else
      l = *(--it);
    printf("%d ", l);
    st.erase(l);
    modify(l, 1);
  }
  printf("\n");
  return 0;
}
