#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAX = 2e5 + 5;
int bit[MAX], a[MAX], b[MAX];
int read(int idx) {
  int result = 0;
  while (idx > 0) {
    result += bit[idx];
    idx -= (idx & -idx);
  }
  return result;
}
void update(int idx, int new_val) {
  while (idx < MAX) {
    bit[idx] += new_val;
    idx += (idx & -idx);
  }
}
int search(int lo, int hi, int target) {
  while (lo < hi) {
    int mid = (lo + hi) >> 1;
    if (read(mid) >= target)
      hi = mid;
    else
      lo = mid + 1;
  }
  return lo;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  for (int i = n - 1; i >= 0; i--) {
    update(a[i] + 1, 1);
    a[i] = read(a[i]);
  }
  memset(bit, 0, sizeof bit);
  for (int i = n - 1; i >= 0; i--) {
    update(b[i] + 1, 1);
    b[i] = read(b[i]);
  }
  for (int i = n - 1; i > 0; i--) {
    a[i] += b[i];
    a[i - 1] += a[i] / (n - i);
    a[i] = a[i] % (n - i);
  }
  a[0] += b[0];
  a[0] %= n;
  memset(bit, 0, sizeof bit);
  for (int i = 1; i <= n; i++) update(i, 1);
  for (int i = 0; i < n; i++) {
    a[i] = search(1, n, a[i] + 1) - 1;
    update(a[i] + 1, -1);
  }
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  return 0;
}
