#include <bits/stdc++.h>
using namespace std;
bool debug;
const int inf = 1e9 + 5;
const int nax = 1e6 + 5;
const int pot = 512 * 1024;
int n;
int tr[2 * pot + 5];
vector<int> f() {
  vector<int> w;
  for (int i = (0); i <= ((n)-1); ++i) {
    int a;
    scanf("%d", &a);
    for (int x = a + pot; x > 0; x /= 2) tr[x]++;
    int licz = 0;
    for (int x = a + pot; x > 0; x /= 2)
      if (x % 2 == 1) licz += tr[x - 1];
    w.push_back(a - licz);
  }
  for (int i = (0); i <= ((2 * pot + 5) - 1); ++i) tr[i] = 0;
  if (debug)
    for (auto a : w) printf("%d ", a);
  if (debug) puts("");
  return w;
}
int main(int argc, char* argv[]) {
  debug = argc > 1;
  scanf("%d", &n);
  vector<int> a = f();
  vector<int> b = f();
  for (int i = (1); i <= ((n)); ++i) {
    int s = a[n - i] + b[n - i];
    if (i < n) a[n - i - 1] += s / i;
    a[n - i] = s % i;
  }
  if (debug) {
    puts("zsumowane:");
    for (auto x : a) printf("%d ", x);
    puts("\n\n");
  }
  for (int i = (0); i <= ((n)-1); ++i) tr[i + pot] = 1;
  for (int i = (pot - 1); i >= (1); --i) tr[i] = tr[2 * i] + tr[2 * i + 1];
  for (auto x : a) {
    int low = x, high = n - 1;
    while (low < high) {
      if (debug) printf("\n\ndupka = %d %d\n", low, high);
      int med = (low + high) / 2;
      int licz = 0;
      for (int i = pot + med; i > 0; i /= 2)
        if (i % 2 == 1) licz += tr[i - 1];
      if (licz > x || (licz == x && tr[pot + med] == 1))
        high = med;
      else
        low = med + 1;
      if (debug) printf("dup2 = %d %d\n\n", low, high);
    }
    assert(tr[pot + low] == 1);
    for (int i = pot + low; i > 0; i /= 2) tr[i]--;
    printf("%d ", low);
  }
  return 0;
}
