#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int n;
int a[maxn], b[maxn], contora[maxn], contorb[maxn], contor[maxn], bits[maxn],
    ans[maxn];
int lowbit(int x) { return x & (-x); }
void add(int x, int p) {
  x++;
  for (int i = x; i <= n; i += lowbit(i)) bits[i] += p;
}
int query(int x) {
  int ans = 0;
  for (int i = x; i > 0; i -= lowbit(i)) {
    ans += bits[i];
  }
  return ans;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> b[i];
  memset(bits, 0, sizeof(bits));
  for (int i = 1; i <= n; i++) {
    contora[i] = a[i] - query(a[i]);
    add(a[i], 1);
  }
  memset(bits, 0, sizeof(bits));
  for (int i = 1; i <= n; i++) {
    contorb[i] = b[i] - query(b[i]);
    add(b[i], 1);
  }
  for (int i = 1; i <= n; i++) contor[i] = contora[i] + contorb[i];
  for (int i = n - 1; i >= 1; i--) {
    contor[i - 1] += contor[i] / (n - i + 1);
    contor[i] %= (n - i + 1);
  }
  memset(bits, 0, sizeof(bits));
  for (int i = 0; i < n; i++) add(i, 1);
  for (int i = 1; i <= n; i++) {
    int l = 1, r = n;
    while (l < r) {
      int mid = l + (r - l + 1) / 2;
      if (query(mid - 1) <= contor[i])
        l = mid;
      else
        r = mid - 1;
    }
    ans[i] = l - 1;
    add(ans[i], -1);
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
}
