#include <bits/stdc++.h>
using namespace std;
const int MN = 200001;
int n;
int arrs[2][MN];
int narrs[2][MN];
int cc[MN];
bool vst[MN];
int lowbit(int x) { return x & (-x); }
int dsum(int n) {
  ++n;
  int sum = 0;
  while (n > 0) {
    sum += cc[n];
    n -= lowbit(n);
  }
  return sum;
}
void dadd(int pos, int x) {
  ++pos;
  while (pos <= MN) {
    cc[pos] += x;
    pos += lowbit(pos);
  }
}
void perton(int *src, int *dst) {
  memset(cc, 0, sizeof(int) * (n + 1));
  for (int i = 0; i < n; ++i) {
    dst[i] = src[i] - dsum(src[i]);
    dadd(src[i], 1);
  }
}
void ntoper(int *src, int *dst) {
  memset(cc, 0, sizeof(int) * (n + 1));
  memset(vst, 0, n + 1);
  for (int i = 0; i < n - 1; ++i) {
    int l = 0, r = n - 1, m = 0;
    while (l <= r) {
      m = (l + r) >> 1;
      int v = m - dsum(m);
      if (v == src[i]) {
        if (vst[m])
          r = m - 1;
        else
          break;
      } else if (v < src[i]) {
        l = m + 1;
      } else {
        r = m - 1;
      }
    }
    dst[i] = m;
    vst[m] = true;
    dadd(m, 1);
  }
  for (int i = 0; i < n; ++i) {
    if (!vst[i]) {
      dst[n - 1] = i;
      break;
    }
  }
}
void permadd() {
  int c = 0;
  arrs[0][n - 1] = 0;
  int tv, ts;
  for (int i = n - 2; i > -1; --i) {
    tv = n - i;
    ts = narrs[0][i] + narrs[1][i] + c;
    arrs[0][i] = ts % tv;
    c = ts / tv;
  }
}
void printarr(int *arr, int len) {
  cout << arr[0];
  for (int i = 1; i < n; ++i) cout << ' ' << arr[i];
  cout << endl;
}
int main() {
  memset(cc, 0, sizeof(int) * MN);
  while (cin >> n) {
    for (int i = 0; i < 2; ++i) {
      for (int j = 0; j < n; ++j) {
        cin >> arrs[i][j];
      }
      perton(arrs[i], narrs[i]);
    }
    permadd();
    ntoper(arrs[0], narrs[0]);
    printarr(narrs[0], n);
  }
  return 0;
}
