#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1.0);
const int INF = 0x3f3f3f3f;
const long long inf = (((long long)1) << 61) + 5;
const int N = 200005;
int a[N];
int b[N];
int f1[N];
int f2[N];
int bit[N];
int n;
int sum(int i) {
  int s = 0;
  while (i > 0) {
    s += bit[i];
    i -= i & -i;
  }
  return s;
}
void add(int i, int x) {
  while (i <= n + 1) {
    bit[i] += x;
    i += i & -i;
  }
}
int get(int x) {
  int ans = n, l = 1, r = n;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (sum(mid) >= x) {
      ans = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    int x = sum(a[i]);
    int tmp = a[i] - x;
    f1[n - i - 1] = tmp;
    add(a[i] + 1, 1);
  }
  memset(bit, 0, sizeof bit);
  for (int i = 0; i < n; i++) {
    scanf("%d", &b[i]);
    int x = sum(b[i]);
    int tmp = b[i] - x;
    f2[n - i - 1] = tmp;
    add(b[i] + 1, 1);
  }
  for (int i = 0; i < n; i++) {
    f1[i] += f2[i];
    f1[i + 1] += f1[i] / (i + 1);
    f1[i] %= (i + 1);
  }
  memset(bit, 0, sizeof bit);
  for (int i = 1; i <= n; i++) add(i, 1);
  for (int i = n - 1; i >= 0; i--) {
    int ans = get(f1[i] + 1);
    printf("%d ", ans - 1);
    add(ans, -1);
  }
  puts("");
  return 0;
}
