#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
const int N = 200007;
int n, a[N], b[N], c[N];
struct Fenwcik {
  int T[N];
  void add(int i) {
    for (++i; i < N; i += (i & -i)) ++T[i];
  }
  void del(int i) {
    for (++i; i < N; i += (i & -i)) --T[i];
  }
  int getKth(int k) {
    int start = 0;
    ++k;
    for (int i = 20; i >= 0; --i) {
      int to = start + (1 << i);
      if (to >= N) continue;
      if (T[to] < k) {
        k -= T[to];
        start = to;
      }
    }
    return start;
  }
  int get(int i) {
    int ret = 0;
    for (++i; i; i -= (i & -i)) ret += T[i];
    return ret;
  }
} t1, t2;
void solve() {
  scanf("%d", &n);
  for (int i = 0; i < (n); ++i) scanf("%d", &a[i]);
  for (int i = 0; i < (n); ++i) scanf("%d", &b[i]);
  int carry = 0;
  for (int i = n - 1; i >= 0; --i) {
    int val = t1.get(a[i]) + t2.get(b[i]) + carry;
    t1.add(a[i]);
    t2.add(b[i]);
    c[i] = val % (n - i);
    carry = val / (n - i);
  }
  for (int i = 0; i < (n); ++i) {
    int x = t1.getKth(c[i]);
    t1.del(x);
    printf("%d ", x);
  }
  puts("");
}
void testGen() {
  FILE *f = fopen("input.txt", "w");
  fclose(f);
}
int main() {
  cerr << fixed;
  cerr.precision(5);
  solve();
  return 0;
}
