#include <bits/stdc++.h>
using namespace std;
int bit[212345], a[212345], b[212345];
inline void update(int i, int v) {
  while (i < 212345) {
    bit[i] += v;
    i += (i & (-i));
  }
}
inline int query(int i) {
  if (i == 0) return 0;
  int r = 0;
  while (i > 0) {
    r += bit[i];
    i -= (i & (-i));
  }
  return r;
}
inline int binary(int z, int n) {
  int lo = 0;
  int hi = n - 1;
  while (lo < hi) {
    int mid = (lo + hi) >> 1;
    if (mid - query(mid + 1) >= z) {
      hi = mid;
    } else {
      lo = mid + 1;
    }
  }
  return lo;
}
void solve() {
  int n, x;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &x);
    a[i] = x - query(x + 1);
    update(x + 1, 1);
  }
  memset(bit, 0, sizeof bit);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &x);
    b[i] = x - query(x + 1);
    update(x + 1, 1);
  }
  int c;
  for (int i = n - 1; i >= 0; --i) {
    c = a[i] + b[i];
    if (c >= n - i) {
      if (i > 0) a[i - 1] += c / (n - i);
      c %= (n - i);
    }
    a[i] = c;
  }
  memset(bit, 0, sizeof bit);
  for (int i = 0; i < n; ++i) {
    int bs = binary(a[i], n);
    update(bs + 1, 1);
    printf("%d ", bs);
  }
  printf("\n");
}
int main() {
  int t = 1;
  while (t--) solve();
  return 0;
}
