#include <bits/stdc++.h>
using namespace std;
int a[210000], b[210000], c[210000], n;
int lowbit(int x) { return x & (-x); }
void add(int x, int w) {
  for (; x <= n; x += lowbit(x)) c[x] += w;
}
int find(int x) {
  int ans = 0;
  for (; x; x -= lowbit(x)) ans += c[x];
  return ans;
}
int main() {
  scanf("%d", &n);
  memset(c, 0, sizeof c);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), a[i]++;
  for (int i = n; i; i--) b[i] = find(a[i]), add(a[i], 1);
  memset(c, 0, sizeof c);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), a[i]++;
  for (int i = n; i; i--) b[i] += find(a[i]), add(a[i], 1);
  for (int i = n; i; i--) {
    b[i - 1] += b[i] / (n - i + 1);
    b[i] %= n - i + 1;
  }
  memset(c, 0, sizeof c);
  for (int i = 1; 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) / 2;
      if (find(mid) > b[i])
        r = mid;
      else
        l = mid + 1;
    }
    add(l, -1);
    printf("%d%c", l - 1, i == n ? '\n' : ' ');
  }
  return 0;
}
