#include <bits/stdc++.h>
const int MAXN = 2e5 + 10;
int n;
int a[MAXN], b[MAXN];
namespace bit {
int a[MAXN];
void init() { std::fill(a + 1, a + n + 1, 0); }
void add(int x, int y) {
  for (; x <= n; x += x & (-x)) {
    a[x] += y;
  }
}
int query(int x) {
  int ans = 0;
  for (; x > 0; x -= x & (-x)) {
    ans += a[x];
  }
  return ans;
}
}  // namespace bit
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    a[i]++;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", b + i);
    b[i]++;
  }
  static int p[MAXN], q[MAXN];
  for (int i = 1; i <= n; i++) {
    p[i] = a[i] - bit::query(a[i]) - 1;
    bit::add(a[i], 1);
  }
  bit::init();
  for (int i = 1; i <= n; i++) {
    q[i] = b[i] - bit::query(b[i]) - 1;
    bit::add(b[i], 1);
  }
  static int sum[MAXN];
  for (int i = n; i >= 1; i--) {
    sum[i] += p[i] + q[i];
    int k = n - i + 1;
    sum[i - 1] = sum[i] / k;
    sum[i] %= k;
  }
  bit::init();
  for (int i = 1; i <= n; i++) {
    int l = 1, r = n, ans = 0;
    while (l <= r) {
      int mid = (l + r) >> 1;
      if (mid - bit::query(mid) - 1 >= sum[i]) {
        ans = mid;
        r = mid - 1;
      } else {
        l = mid + 1;
      }
    }
    bit::add(ans, 1);
    printf("%d ", ans - 1);
  }
  printf("\n");
}
