#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 9;
const long long mod = 1e9 + 7;
int n, a[maxn], b[maxn], xa[maxn], xb[maxn];
int fen[maxn], ans[maxn], res[maxn], seg[maxn * 4];
int get(int x) {
  int res = 0;
  for (; x; x -= x & -x) res += fen[x];
  return res;
}
void upd(int x, int val) {
  for (; x < maxn; x += x & -x) fen[x] += val;
}
void build(int l = 1, int r = n + 1, int id = 1) {
  if (r - l == 1) {
    seg[id] = 1;
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, id * 2);
  build(mid, r, id * 2 + 1);
  seg[id] = seg[id * 2] + seg[id * 2 + 1];
}
int query(int k, int l = 1, int r = n + 1, int id = 1) {
  if (r - l == 1) return l;
  int mid = (l + r) >> 1;
  if (seg[id * 2] >= k) return query(k, l, mid, id * 2);
  return query(k - seg[id * 2], mid, r, id * 2 + 1);
}
void update(int ind, int l = 1, int r = n + 1, int id = 1) {
  if (ind < l || ind >= r) return;
  if (r - l == 1) {
    seg[id] = 0;
    return;
  }
  int mid = (l + r) >> 1;
  update(ind, l, mid, id * 2);
  update(ind, mid, r, id * 2 + 1);
  seg[id] = seg[id * 2] + seg[id * 2 + 1];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i]++;
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    b[i]++;
  }
  memset(fen, 0, sizeof fen);
  for (int i = n - 1; i >= 0; i--) {
    xa[i] = get(a[i]);
    upd(a[i], 1);
  }
  memset(fen, 0, sizeof fen);
  for (int i = n - 1; i >= 0; i--) {
    xb[i] = get(b[i]);
    upd(b[i], 1);
  }
  int f = 0;
  for (int i = n - 1; i >= 0; i--) {
    int cur = xa[i] + xb[i] + f;
    ans[i] = cur % (n - i);
    f = cur / (n - i);
  }
  build();
  for (int i = 0; i < n; i++) {
    res[i] = query(ans[i] + 1);
    update(res[i]);
  }
  for (int i = 0; i < n; i++) cout << res[i] - 1 << " ";
  cout << "\n";
}
