#include <bits/stdc++.h>
using namespace std;
int n, a[200005], b[200005];
int f1[200005], f2[200005], f[200005];
int ans[200005];
int c[200005];
int dq;
int lowbit(int x) { return x & (-x); }
void add(int x, int w) {
  for (int i = x; i <= 200005; i += lowbit(i)) {
    c[i] += w;
  }
}
int sum(int x) {
  int ans = 0;
  for (int i = x; i > 0; i -= lowbit(i)) {
    ans += c[i];
  }
  return ans;
}
int find(int x) {
  int l = 1, r = n, mid;
  int ans = 0;
  while (l <= r) {
    mid = (l + r) / 2;
    if (sum(mid) >= x) {
      ans = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= n; ++i) scanf("%d", &b[i]);
  memset(c, 0, sizeof(c));
  for (int i = 1; i <= n; ++i) add(i, 1);
  for (int i = 1; i <= n; ++i) {
    f1[n - i] = sum(a[i]);
    add(a[i] + 1, -1);
  }
  memset(c, 0, sizeof(c));
  for (int i = 1; i <= n; ++i) add(i, 1);
  for (int i = 1; i <= n; ++i) {
    f2[n - i] = sum(b[i]);
    add(b[i] + 1, -1);
  }
  for (int i = 0; i < n; ++i) {
    f[i] += f1[i] + f2[i];
    f[i + 1] += f[i] / (i + 1);
    f[i] = f[i] % (i + 1);
  }
  memset(c, 0, sizeof(c));
  for (int i = 1; i <= n; ++i) add(i, 1);
  for (int i = n - 1; i >= 0; --i) {
    dq = find(f[i] + 1);
    ans[n - i] = dq;
    add(dq, -1);
  }
  for (int i = 1; i <= n; ++i) printf("%d ", ans[i] - 1);
  return 0;
}
