#include <bits/stdc++.h>
using namespace std;
vector<int> w[20];
int n;
int p[200010], q[200010];
int s[200010];
int a[200010], b[200010], c[200010], res[200010];
bool vis[200010];
int get(int x) {
  int y = 0;
  if (x < 0) return 0;
  for (; x >= 1; x -= x & -x) y += s[x];
  return y;
}
void update(int x, int y) {
  if (x < 0) return;
  for (; x <= n; x += x & -x) s[x] += y;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", p + i);
  for (int i = 0; i < n; i++) scanf("%d", q + i);
  for (int i = 0; i < n; i++) update(i + 1, 1);
  for (int i = 0; i < n; i++) {
    a[i] = get(p[i]);
    update(p[i] + 1, -1);
  }
  for (int i = 0; i < n; i++) update(i + 1, 1);
  for (int i = 0; i < n; i++) {
    b[i] = get(q[i]);
    update(q[i] + 1, -1);
  }
  int r = 0;
  for (int i = n - 1; i >= 0; i--) {
    c[i] = (a[i] + b[i] + r);
    if (c[i] >= (n - i))
      r = 1;
    else
      r = 0;
    c[i] %= (n - i);
  }
  for (int i = 0; i < n; i++) update(i + 1, 1);
  int m = 1;
  for (int i = 0; i < n; i++) {
    int lo = m;
    int hi = n;
    while (lo < hi) {
      int mi = (lo + hi) >> 1;
      if (get(mi - 1) < c[i])
        lo = mi + 1;
      else
        hi = mi;
    }
    while (vis[lo]) lo++;
    res[i] = lo - 1;
    update(lo, -1);
    vis[lo] = 1;
    while (vis[m]) m++;
  }
  for (int i = 0; i < n; i++) cout << res[i] << " ";
  cout << endl;
  return 0;
}
