#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T min(T &a, T &b) {
  return a < b ? a : b;
}
template <class T>
inline T max(T &a, T &b) {
  return a > b ? a : b;
}
template <class T>
void read(T &x) {
  char ch;
  while ((ch = getchar()) && !(ch >= '0' && ch <= '9'))
    ;
  x = ch - '0';
  while ((ch = getchar()) && (ch >= '0' && ch <= '9')) x = x * 10 + ch - '0';
}
long long Pow(long long a, long long b, long long mod) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long Pow(long long a, long long b) {
  long long res = 1;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a;
    a = a * a;
  }
  return res;
}
const int N = 300000;
int tr[N];
int a[N], b[N], n, t[N], c[N], li[N];
int ask(int x) {
  int ans = 0;
  for (int i = x; i; i -= i & (-i)) ans += tr[i];
  return ans;
}
void change(int x, int c) {
  for (int i = x; i <= n; i += i & (-i)) tr[i] += c;
  return;
}
void change(int *a) {
  for (int i = 1; i <= n; i++) tr[i] = 0;
  for (int i = 1; i <= n; i++) t[i] = i;
  for (int i = 1; i <= n; i++) change(i, 1);
  for (int i = 1; i <= n; i++) {
    t[i] = ask(a[i]) - 1;
    change(a[i], -1);
  }
  for (int i = 1; i <= n; i++) a[i] = t[i];
}
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]++;
  change(a);
  change(b);
  int x = 0;
  for (int i = n; i >= 1; i--) {
    c[i] = a[i] + b[i] + x;
    x = 0;
    if (c[i] >= n - i + 1) x = c[i] / (n - i + 1), c[i] %= n - i + 1;
  }
  for (int i = 1; i <= n; i++) t[i] = 0;
  for (int i = 1; i <= n; i++) change(i, 1);
  for (int i = 1; i <= n; i++) {
    int l = 1, r = n, mid, ans;
    while (l <= r) {
      mid = l + r >> 1;
      if (ask(mid) < c[i] + 1)
        l = mid + 1;
      else
        r = mid - 1, ans = mid;
    }
    li[i] = ans;
    change(li[i], -1);
  }
  for (int i = 1; i <= n; i++) printf("%d ", li[i] - 1);
  puts("");
}
