#include <bits/stdc++.h>
using namespace std;
long long bit1[4 * 100000 + 5], bit2[4 * 100000 + 5], bit[2 * 100000 + 5];
int maxval = 2 * 100000 + 5;
void update1(long long idx, long long val) {
  while (idx <= maxval) {
    bit1[idx] += val;
    idx += (idx & -idx);
  }
}
long long query1(long long idx) {
  long long sum = 0;
  while (idx > 0) {
    sum += bit1[idx];
    idx -= (idx & -idx);
  }
  return sum;
}
void update2(long long idx, long long val) {
  while (idx <= maxval) {
    bit2[idx] += val;
    idx += (idx & -idx);
  }
}
long long query2(long long idx) {
  long long sum = 0;
  while (idx > 0) {
    sum += bit2[idx];
    idx -= (idx & -idx);
  }
  return sum;
}
void update(long long idx, long long val) {
  while (idx <= maxval) {
    bit[idx] += val;
    idx += (idx & -idx);
  }
}
long long query(long long idx) {
  long long sum = 0;
  while (idx > 0) {
    sum += bit[idx];
    idx -= (idx & -idx);
  }
  return sum;
}
int a[100000 * 2 + 5], b[2 * 100000 + 5];
int main() {
  int n, i, j;
  int ans[2 * 100000 + 5];
  memset(bit1, 0, sizeof(bit1));
  memset(bit2, 0, sizeof(bit2));
  memset(bit, 0, sizeof(bit));
  cin >> n;
  for (i = 0; i < n; ++i) cin >> a[i];
  for (i = 0; i < n; ++i) cin >> b[i];
  i = 0, j = 0;
  while (i < n) {
    int l1 = query1(a[i] + 1);
    int l2 = query2(b[i] + 1);
    update1(a[i] + 1, 1);
    update2(b[i] + 1, 1);
    l1 = a[i] - l1;
    l2 = b[i] - l2;
    int mo = n - i;
    ans[i] = (l1 + l2) % mo;
    if ((l1 + l2) == mo - 1)
      i++;
    else if ((l1 + l2) < mo - 1) {
      j = i;
      i++;
    } else {
      while (j < i) {
        ans[j] = (ans[j] + 1) % (n - j);
        j++;
      }
      j = i;
      i++;
    }
  }
  for (i = 1; i <= n; ++i) update(i, 1);
  for (i = 1; i <= n; ++i) {
    int lo = 1;
    int hi = n;
    int an1;
    while (lo <= hi) {
      int mid = (lo + hi) / 2;
      int an = query(mid - 1);
      if (an < ans[i - 1])
        lo = mid + 1;
      else if (an > ans[i - 1])
        hi = mid - 1;
      else {
        an1 = mid;
        lo = mid + 1;
      }
    }
    cout << an1 - 1 << " ";
    update(an1, -1);
  }
  return 0;
}
