#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
int la[MAXN], lb[MAXN], a[MAXN], b[MAXN], f[MAXN], s[MAXN];
int n;
int ff[MAXN];
int tree[MAXN];
int magic(int x) { return x & (-x); }
void add(int x, int d) {
  x++;
  while (x <= n) {
    tree[x] += d;
    x += magic(x);
  }
}
int sum(int x) {
  x++;
  int ans = 0;
  while (x) {
    ans += tree[x];
    x -= magic(x);
  }
  return ans;
}
void clear() {
  for (int i = 0; i < MAXN; i++) {
    tree[i] = 0;
  }
}
int find(int i) {
  int r = n;
  int l = 0;
  while (l < r) {
    int mid = l + (r - l + 1) / 2;
    int t = sum(mid - 1);
    if (t <= s[i])
      l = mid;
    else
      r = mid - 1;
  }
  add(l, -1);
  return l;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> la[i];
  for (int i = 0; i < n; i++) cin >> lb[i];
  for (int i = 0; i < n; i++) {
    add(i, 1);
  }
  for (int i = 0; i < n; i++) {
    a[i] = sum(la[i] - 1);
    add(la[i], -1);
  }
  clear();
  for (int i = 0; i < n; i++) {
    add(i, 1);
  }
  for (int i = 0; i < n; i++) {
    b[i] = sum(lb[i] - 1);
    add(lb[i], -1);
    s[i] = a[i] + b[i];
  }
  clear();
  for (int i = 0; i < n; i++) {
    add(i, 1);
    ff[i] = 1;
  }
  for (int i = n - 1; i > 0; i--) {
    s[i - 1] += s[i] / (n - i);
    s[i] %= (n - i);
  }
  s[0] %= n;
  int rr = n - 1;
  for (int i = 0; i < n; i++) {
    int l = find(i);
    ff[l] = 0;
    if (!i) {
      cout << l;
    } else {
      cout << " " << l;
    }
    while (!ff[rr]) {
      rr--;
    }
  }
  return 0;
}
