#include <bits/stdc++.h>
using namespace std;
struct BIT {
  int n;
  vector<long long> bit;
  BIT(int n) : n(n), bit(n + 1) {}
  void add(int k, long long v) {
    k++;
    while (k <= n) {
      bit[k] += v;
      k += k & -k;
    }
  }
  long long sum(int k) {
    long long s = 0;
    while (k > 0) {
      s += bit[k];
      k -= k & -k;
    }
    return s;
  }
  int find(long long v) {
    int m = 1;
    while (m <= n) m <<= 1;
    int k = 0;
    while (m > 0) {
      if ((k | m) <= n && bit[k | m] < v) {
        v -= bit[k | m];
        k |= m;
      }
      m >>= 1;
    }
    return k;
  }
};
int n;
vector<int> ord(const vector<int> &a) {
  vector<int> r(n);
  BIT bit(n);
  for (int i = 0; i < n; i++) {
    bit.add(i, 1);
  }
  for (int i = 0; i < n; i++) {
    r[i] = bit.sum(a[i]);
    bit.add(a[i], -1);
  }
  return r;
}
vector<int> perm(const vector<int> &oa) {
  vector<int> r(n);
  BIT bit(n);
  for (int i = 0; i < n; i++) {
    bit.add(i, 1);
  }
  for (int i = 0; i < n; i++) {
    int p = bit.find(oa[i] + 1);
    r[i] = p;
    bit.add(p, -1);
  }
  return r;
}
int main() {
  scanf("%d", &n);
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &b[i]);
  }
  vector<int> oa = ord(a);
  vector<int> ob = ord(b);
  vector<int> oc(n);
  for (int i = n - 1; i >= 0; i--) {
    int m = n - i;
    if (i > 0) {
      oc[i - 1] += (oc[i] + oa[i] + ob[i]) / m;
    }
    oc[i] = (oc[i] + oa[i] + ob[i]) % m;
  }
  vector<int> c = perm(oc);
  for (int i = 0; i < n; i++) {
    printf("%d%c", c[i], " \n"[i == n - 1]);
  }
}
