#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long lnf = 0x3f3f3f3f3f3f3f3f;
const double dnf = 1e18;
const int mod = 1000000007;
const double eps = 1e-8;
const double pi = acos(-1.0);
const int maxn = 200100;
const int maxm = 100100;
const int up = 100000;
int p[maxn], q[maxn];
int c[maxn], b[maxn];
int n, t;
void add(int x, int val) {
  for (; x < maxn; x += (x & (-x))) c[x] += val;
}
int askans(int x) {
  int ans = 0;
  for (; x; x -= (x & (-x))) ans += c[x];
  return ans;
}
int askpos(int x) {
  int sum = 0, now = 0;
  for (int i = t; i >= 0; i--) {
    if (now + (1 << i) <= n && sum + c[now + (1 << i)] < x)
      sum += c[now + (1 << i)], now += (1 << i);
  }
  return now + 1;
}
void init(void) {
  memset(c, 0, sizeof(c));
  t = log2(n) + 1;
  for (int i = 1; i <= n; i++) add(i, 1);
}
int main(void) {
  scanf("%d", &n);
  init();
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
    p[i]++;
    add(p[i], -1);
    b[i] += askans(p[i]);
  }
  init();
  for (int i = 1; i <= n; i++) {
    scanf("%d", &q[i]);
    q[i]++;
    add(q[i], -1);
    b[i] += askans(q[i]);
  }
  for (int i = n; i >= 1; i--)
    b[i - 1] += b[i] / (n - i + 1), b[i] %= (n - i + 1);
  init();
  for (int i = 1; i <= n; i++) {
    int now = askpos(b[i] + 1);
    printf("%d ", now - 1);
    add(now, -1);
  }
  putchar('\n');
  return 0;
}
