#include <bits/stdc++.h>
struct SumTree {
  int BOTTOM;
  std::vector<int> t;
  void build(const std::vector<int> &A) {
    BOTTOM = 1;
    while (BOTTOM < (int)(A).size()) BOTTOM <<= 1;
    t.resize(BOTTOM << 1);
    for (int i = 0; i < ((int)(A).size()); ++i) t[BOTTOM + i] = A[i];
  }
  int query(int v) {
    int sum = 0;
    v += BOTTOM;
    while (v > 0) {
      sum += t[v];
      v >>= 1;
    }
    return sum;
  }
  void add(int a, int b, int v) {
    a += BOTTOM;
    b += BOTTOM + 1;
    while (a < b) {
      if (a & 1) t[a++] += v;
      if (b & 1) t[--b] += v;
      a >>= 1;
      b >>= 1;
    }
  }
};
struct KthTree {
  int BOTTOM;
  std::vector<int> t;
  void build(int size) {
    BOTTOM = 1;
    while (BOTTOM < size) BOTTOM <<= 1;
    t.resize(BOTTOM * 2);
    for (int i = 0; i < (size); ++i) t[BOTTOM + i] = 1;
    for (int i = BOTTOM - 1; i >= 1; --i) {
      t[i] = t[i << 1] + t[(i << 1) + 1];
    }
  }
  void rem(int a) {
    a += BOTTOM;
    while (a > 0) {
      t[a]--;
      a >>= 1;
    }
  }
  int kth(int k) {
    int v = 1;
    while (v < BOTTOM) {
      if (t[v << 1] <= k)
        k -= t[v << 1], v = (v << 1) + 1;
      else
        v <<= 1;
    }
    return v - BOTTOM;
  }
};
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  int n;
  std::cin >> n;
  std::vector<int> A(n), B(n);
  for (int i = 0; i < (n); ++i) std::cin >> A[i];
  for (int i = 0; i < (n); ++i) std::cin >> B[i];
  std::vector<int> xd;
  for (int i = 0; i < (n); ++i) xd.push_back(i);
  SumTree fs, sc;
  fs.build(xd);
  sc.build(xd);
  std::vector<int> ret(n);
  std::vector<int> Af(n), Bf(n);
  for (int i = 0; i < (n); ++i) {
    Af[i] = fs.query(A[i]);
    Bf[i] = sc.query(B[i]);
    fs.add(A[i], n - 1, -1);
    sc.add(B[i], n - 1, -1);
  }
  int carry = 0;
  std::reverse(Af.begin(), Af.end());
  std::reverse(Bf.begin(), Bf.end());
  for (int i = 0; i < (n); ++i) {
    ret[i] = (Af[i] + Bf[i] + carry) % (i + 1);
    carry = (Af[i] + Bf[i] + carry) / (i + 1);
  }
  std::reverse(ret.begin(), ret.end());
  KthTree tree;
  tree.build(n);
  std::vector<int> ans(n);
  for (int i = 0; i < (n); ++i) {
    ans[i] = tree.kth(ret[i]);
    tree.rem(ans[i]);
  }
  for (auto &i : ans) std::cout << i << " ";
  std::cout << "\n";
  return 0;
}
