#include <bits/stdc++.h>
const int maxn = 200007;
const int T = 1 << 20;
using namespace std;
int A[maxn], B[maxn];
int placeA[maxn], placeB[maxn], placeC[maxn];
int n;
int t[3][T];
int sum(int r, int who) {
  int ret = 0;
  for (; r >= 0; r = (r & (r + 1)) - 1) ret += t[who][r];
  return ret;
}
void inc(int i, int delta, int who) {
  for (; i < n; i = (i | (i + 1))) t[who][i] += delta;
}
int find(int place) {
  int l = -1, r = n - 1;
  while (r - l > 1) {
    int m = (l + r) / 2;
    if (sum(m, 2) >= place)
      r = m;
    else
      l = m;
  }
  assert(sum(r, 2) == place);
  return r;
}
int main() {
  cin >> n;
  for (int i = 0; i < (int)(n); ++i) cin >> A[i];
  for (int i = 0; i < (int)(n); ++i) cin >> B[i];
  for (int i = 0; i < (int)(n); ++i)
    for (int t = 0; t < (int)(3); ++t) inc(i, 1, t);
  vector<int> ans;
  for (int i = 0; i < (int)(n); ++i) {
    placeA[i] = sum(A[i], 0) - 1;
    inc(A[i], -1, 0);
    placeB[i] = sum(B[i], 1) - 1;
    inc(B[i], -1, 1);
  }
  for (int i = (int)(n)-1; i >= 0; --i) {
    placeC[i] += (placeA[i] + placeB[i]);
    if (i != n - 1 && placeC[i] >= n - i) {
      placeC[i] -= n - i;
      if (i) ++placeC[i - 1];
    }
  }
  for (int i = 0; i < (int)(n); ++i) {
    int id = find(placeC[i] + 1);
    ans.push_back(id);
    inc(id, -1, 2);
  }
  for (int i = 0; i < (int)(n); ++i) cout << ans[i] << ' ';
  return 0;
}
