#include <bits/stdc++.h>
char ch[1];
const int N = 200005;
int n, a[N], b[N], c[N], an[N];
using namespace std;
inline int lowbit(int x) { return x & (-x); }
inline void change(int i, int de) {
  int j = i;
  while (j <= n) {
    c[j] += de;
    j += lowbit(j);
  }
}
inline int getsum(int i) {
  int zs = 0;
  int j = i;
  while (j) {
    zs += c[j];
    j -= lowbit(j);
  }
  return zs;
}
inline int read() {
  int x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') positive = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline void write(int a) {
  if (a >= 10) write(a / 10);
  putchar('0' + a % 10);
}
inline void writeln(int a) {
  write(a);
  puts("");
}
inline int chu(int x) {
  int l = 1, r = n;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (mid - getsum(mid) > x)
      r = mid;
    else
      l = mid + 1;
  }
  return l;
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++) {
    a[i] = read() + 1;
    change(a[i], 1);
    a[i] -= getsum(a[i]);
  }
  memset(c, 0, sizeof(c));
  for (int i = 1; i <= n; i++) {
    b[i] = read() + 1;
    change(b[i], 1);
    b[i] -= getsum(b[i]);
  }
  memset(c, 0, sizeof(c));
  for (int i = n; i; i--) {
    an[i] += a[i] + b[i];
    an[i - 1] += an[i] / (n - i + 1);
    an[i] %= (n - i + 1);
  }
  int t;
  for (int i = 1; i <= n; i++) {
    write((t = chu(an[i])) - 1);
    change(t, 1);
    putchar(' ');
  }
}
