#include <bits/stdc++.h>
using namespace std;
int v[222222];
int d[2 * (1 << 18)];
void setv(int k, int n) {
  k += (1 << 18);
  d[k] = n;
  for (k /= 2; k >= 1; k /= 2) {
    d[k] = d[2 * k] + d[2 * k + 1];
  }
}
int qu(int a, int b) {
  a += (1 << 18);
  b += (1 << 18);
  int s = 0;
  while (a <= b) {
    if (a & 1) s += d[a++];
    if (~b & 1) s += d[b--];
    a /= 2;
    b /= 2;
  }
  return s;
}
int qu2(int n) {
  int p = 1;
  n++;
  while (p < (1 << 18)) {
    if (d[2 * p] >= n)
      p *= 2;
    else {
      n -= d[2 * p];
      p = 2 * p + 1;
    }
  }
  return p - (1 << 18);
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v[i] += x - qu(0, x);
    setv(x, 1);
  }
  for (int i = 0; i < n; i++) setv(i, 0);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v[i] += x - qu(0, x);
    setv(x, 1);
  }
  for (int i = n - 1; i >= 0; i--) {
    int k = v[i] / (n - i);
    v[i] %= (n - i);
    if (i) v[i - 1] += k;
  }
  for (int i = 0; i < n; i++) setv(i, 1);
  for (int i = 0; i < n; i++) {
    int x = qu2(v[i]);
    setv(x, 0);
    cout << x << " ";
  }
  cout << endl;
}
