#include <bits/stdc++.h>
using namespace std;
const int MX = (1 << 20);
class BIT {
  int MX, *bit;

 public:
  BIT() {
    MX = 0;
    bit = NULL;
  };
  void init(int N) {
    MX = N;
    bit = new int[MX + 1];
    for (int j = 0; j <= MX; j++) bit[j] = 0;
  }
  int get(int x) {
    int ret = 0;
    while (x > 0) {
      ret += bit[x];
      x -= x & (-x);
    }
    return ret;
  }
  void add(int x, int V) {
    while (x <= MX) {
      bit[x] += V;
      x += x & (-x);
    }
  }
} tree;
int n;
void nk7(vector<int> v, vector<int> &sol) {
  sol.clear();
  tree.init(n);
  for (int j = 1; j <= n; j++) tree.add(j, 1);
  for (int j = 0; j < n; j++) {
    tree.add(v[j] + 1, -1);
    sol.push_back(tree.get(v[j] + 1));
  }
}
int main() {
  scanf("%d", &n);
  vector<int> v[2], res[2];
  for (int ii = 0; ii < 2; ii++) {
    for (int j = 0; j < n; j++) {
      int x;
      scanf("%d", &x);
      v[ii].push_back(x);
    }
    nk7(v[ii], res[ii]);
  }
  vector<int> sol;
  for (int j = 0; j < n; j++) sol.push_back(res[0][j] + res[1][j]);
  reverse(sol.begin(), sol.end());
  for (int j = 0; j < n; j++) {
    if (j != n - 1) sol[j + 1] += sol[j] / (j + 1);
    sol[j] %= (j + 1);
  }
  reverse(sol.begin(), sol.end());
  tree.init(n);
  for (int j = 1; j <= n; j++) tree.add(j, 1);
  vector<int> ujds;
  for (int j = 0; j < n; j++) {
    int st = 1, en = n, mid, best = 0, coef = sol[j];
    while (st <= en) {
      mid = (st + en) / 2;
      if (tree.get(mid) - 1 < coef) {
        best = mid;
        st = mid + 1;
      } else
        en = mid - 1;
    }
    ujds.push_back(best + 1);
    tree.add(best + 1, -1);
  }
  for (auto pp : ujds) printf("%d\n", pp - 1);
}
