#include <bits/stdc++.h>
using namespace std;
int n, m, v, is[30005], act[30005], sol, MAX;
namespace fact_num {
int const N = 200005;
int abi[N];
int que(int p) {
  int r = 0;
  while (p > 0) {
    r += abi[p];
    p -= (p & -p);
  }
  return r;
}
void upd(int p) {
  while (p < N) {
    abi[p] += 1;
    p += (p & -p);
  }
}
struct no {
  int p;
};
bool operator<(no o, no p) {
  int q1 = o.p > 0 ? que(o.p) : 0, q2 = p.p > 0 ? que(p.p) : 0;
  return (abs(o.p) - q1) < (abs(p.p) - q2);
}
vector<int> fac_vi(vector<int> v) {
  vector<int> r;
  memset(abi, 0, sizeof(abi));
  for (int i = 0; i < v.size(); i++) {
    r.push_back(v[i] - que(v[i] + 1));
    upd(v[i] + 1);
  }
  return r;
}
vector<int> per_vi(vector<int> v) {
  vector<int> r;
  set<no> s;
  memset(abi, 0, sizeof(abi));
  for (int i = 0; i < v.size(); i++) s.insert((no){i + 1});
  set<no>::iterator it;
  for (int i = 0; i < v.size(); i++) {
    it = s.find((no){-(v[i] + 1)});
    r.push_back(it->p - 1);
    upd(it->p);
    s.erase(it);
  }
  return r;
}
long long num_perm(vector<int> v) {
  long long r = 0, f = 1;
  v = fac_vi(v);
  for (int i = v.size() - 1, j = 1; i >= 0; i--, j++) {
    r = ((v[i] * f) % 1000007 + r) % 1000007;
    f = (f * (long long)j) % 1000007;
  }
  return r;
}
vector<int> sum_fac_vi(vector<int> o, vector<int> p) {
  vector<int> r;
  for (int i = o.size() - 1, j = 1, rr = 0; i >= 0; i--, j++) {
    r.push_back((o[i] + p[i] + rr) % j);
    rr = (o[i] + p[i] + rr) / j;
  }
  reverse(r.begin(), r.end());
  return r;
}
}  // namespace fact_num
int main() {
  scanf("%d", &n);
  vector<int> l, o;
  for (int i = 0; i < n; i++) {
    scanf("%d", &v);
    l.push_back(v);
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &v);
    o.push_back(v);
  }
  l = fact_num::fac_vi(l);
  o = fact_num::fac_vi(o);
  l = fact_num::sum_fac_vi(l, o);
  l = fact_num::per_vi(l);
  for (int i = 0; i < n; i++) printf("%s%d", (i ? " " : ""), l[i]);
  printf("\n");
  return 0;
}
