#include <bits/stdc++.h>
using namespace std;
long long int insig;
void Out(vector<long long int> x) {
  for (long long int i = 0; i < x.size(); i++) {
    cout << x[i] << " ";
  }
  cout << endl;
}
class ST {
 public:
  long long int N;
  vector<long long int> ar;
  vector<long long int> p;
  long long int neut;
  long long int op(long long int a, long long int b) { return (a + b); }
  ST(vector<long long int> arr) {
    neut = 0;
    N = (long long int)1 << (long long int)ceil(log2(arr.size()));
    for (long long int i = 0; i < arr.size(); i++) {
      ar.push_back(arr[i]);
    }
    for (long long int i = arr.size(); i < N; i++) {
      ar.push_back(neut);
    }
    for (long long int i = 0; i < N; i++) {
      p.push_back(0);
    }
    for (long long int i = 0; i < N; i++) {
      p.push_back(ar[i]);
    }
    long long int cur = N - 1;
    while (cur > 0) {
      p[cur] = op(p[2 * cur], p[2 * cur + 1]);
      cur--;
    }
  }
  long long int query(long long int a, long long int b, long long int c,
                      long long int x, long long int y) {
    if (y < a || x > b) {
      return neut;
    }
    if (x >= a && y <= b) {
      return p[c];
    }
    long long int mid = (x + y) / 2;
    return op(query(a, b, 2 * c, x, mid), query(a, b, 2 * c + 1, mid + 1, y));
  }
  void update(long long int s, long long int a, long long int c,
              long long int x, long long int y) {
    if (y < a || x > a) {
      return;
    }
    p[c] += s;
    if (c == a + N) {
      ar[a] += s;
      return;
    }
    long long int mid = (x + y) / 2;
    update(s, a, 2 * c, x, mid);
    update(s, a, 2 * c + 1, mid + 1, y);
  }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long int N;
  cin >> N;
  vector<long long int> p, q;
  vector<long long int> xx;
  for (long long int i = 0; i < N; i++) {
    xx.push_back(1LL);
  }
  for (long long int IBRO = 0; IBRO < N; IBRO++) {
    cin >> insig;
    p.push_back(insig);
  };
  for (long long int IBRO = 0; IBRO < N; IBRO++) {
    cin >> insig;
    q.push_back(insig);
  };
  vector<long long int> a, b;
  for (long long int i = 0; i < N; i++) {
    a.push_back(0LL);
    b.push_back(0LL);
  }
  ST S1(xx);
  ST S2(xx);
  for (long long int i = 0; i < N; i++) {
    a[i] = S1.query(0, p[i], 1, 0, S1.N - 1) - 1;
    b[i] = S2.query(0, q[i], 1, 0, S2.N - 1) - 1;
    S1.update(-1, p[i], 1, 0, S1.N - 1);
    S2.update(-1, q[i], 1, 0, S2.N - 1);
  }
  vector<long long int> c;
  for (long long int i = 0; i < N; i++) {
    c.push_back(-1);
  }
  long long int carry = 0;
  for (long long int i = N - 1; i >= 0; i--) {
    c[i] = a[i] + b[i] + carry;
    carry = c[i] / (N - i);
    c[i] = c[i] % (N - i);
  }
  vector<long long int> ans;
  for (long long int i = 0; i < N; i++) {
    ans.push_back(-1);
  }
  ST S(xx);
  for (long long int i = 0; i < N; i++) {
    long long int lo = 0;
    long long int hi = S.N - 1;
    while (hi > lo) {
      long long int mid = (lo + hi) / 2;
      if (S.query(0, mid, 1, 0, S.N - 1) > c[i]) {
        hi = mid;
      } else {
        lo = mid + 1;
      }
    }
    ans[i] = lo;
    S.update(-1, ans[i], 1, 0, S.N - 1);
  }
  Out(ans);
  return 0;
}
