#include <bits/stdc++.h>
using namespace std;
class BITree {
 public:
  vector<int> tree;
  int n;
  BITree(int N) {
    n = N;
    tree.assign(n + 1, 0);
    for (int i = 0; i < n; ++i) update(i, 1);
  }
  void reset() {
    this->tree.assign(this->n + 1, 0);
    for (int i = 0; i < n; ++i) this->update(i, 1);
  }
  void update(int i, int v = 1) {
    ++i;
    while (i <= this->n) {
      this->tree[i] += v;
      i += i & (-i);
    }
  }
  int get(int i) {
    int ans = 0;
    ++i;
    while (i > 0) {
      ans += this->tree[i];
      i -= i & (-i);
    }
    return ans - 1;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int p[n], q[n];
  BITree tree(n);
  for (int k = 0; k < 2; ++k) {
    tree.reset();
    int v;
    for (int i = 0; i < n; ++i) {
      cin >> v;
      if (!k)
        p[i] = tree.get(v);
      else
        q[i] = tree.get(v);
      tree.update(v, -1);
    }
  }
  int rem = 0;
  for (int i = n - 1; i + 1; --i) {
    p[i] += q[i] + rem;
    rem = p[i] >= n - i;
    p[i] %= n - i;
  }
  tree.reset();
  for (int i = 0; i < n; ++i) {
    int b = 0, e = n - 1;
    while (e - b) {
      int m = (e + b) / 2;
      if (tree.get(m) >= p[i])
        e = m;
      else
        b = m + 1;
    }
    cout << e << ' ';
    tree.update(e, -1);
  }
  cout << endl;
}
