#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
long long qpow(long long n, long long k) {
  long long ans = 1;
  assert(k >= 0);
  n %= mod;
  while (k > 0) {
    if (k & 1) ans = (ans * n) % mod;
    n = (n * n) % mod;
    k >>= 1;
  }
  return ans % mod;
}
int n, a[200111], b[200111], c2[200111];
class BIT {
 private:
  int a[200111];

 public:
  void add(int i, int x) {
    while (i <= n) {
      a[i] += x;
      i += i & (-i);
    }
  }
  int cal(int i) {
    int ans = 0;
    while (i > 0) {
      ans += a[i];
      i -= i & (-i);
    }
    return ans;
  }
} bit1, bit2, bit3;
int binsearch(int x) {
  int l = 0, r = n - 1, mid;
  while (l <= r) {
    mid = (l + r) / 2;
    if (mid - bit3.cal(mid + 1) < x)
      l = mid + 1;
    else
      r = mid - 1;
  }
  return l;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> b[i];
  for (int i = 1; i <= n; i++) {
    c2[i] += a[i] - bit1.cal(a[i] + 1);
    bit1.add(a[i] + 1, 1);
  }
  for (int i = 1; i <= n; i++) {
    c2[i] += b[i] - bit2.cal(b[i] + 1);
    bit2.add(b[i] + 1, 1);
  }
  for (int i = n; i >= 1; i--) {
    if (c2[i] >= (n - i + 1)) {
      c2[i - 1]++;
      c2[i] -= (n - i + 1);
    }
  }
  for (int i = 1; i <= n; i++) {
    int tmp = binsearch(c2[i]);
    cout << tmp << " ";
    bit3.add(tmp + 1, 1);
  }
  return 0;
}
