#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int tree[N];
int a[N];
int b[N];
int c[N];
int res[N];
inline void update(int idx, int val) {
  while (idx < N) {
    tree[idx] += val;
    idx += idx & -idx;
  }
}
inline int query(int idx) {
  int sm = 0;
  while (idx > 0) {
    sm += tree[idx];
    idx -= idx & -idx;
  }
  return sm;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    ;
    a[i]++;
  }
  for (int i = n - 1; i >= 0; i--) {
    int x = a[i];
    a[i] = query(x - 1);
    update(x, 1);
  }
  memset(tree, 0, sizeof(tree));
  for (int i = 0; i < n; i++) {
    scanf("%d", &b[i]);
    ;
    b[i]++;
  }
  for (int i = n - 1; i >= 0; i--) {
    int x = b[i];
    b[i] = query(x - 1);
    update(x, 1);
  }
  int carry = 0;
  for (int i = n - 1; i >= 0; i--) {
    int sum = a[i] + b[i] + carry;
    c[i] = sum % (n - i);
    carry = sum / (n - i);
  }
  memset(tree, 0, sizeof(tree));
  for (int i = 1; i <= n; i++) {
    update(i, 1);
  }
  for (int i = 0; i < n; i++) {
    int num = c[i];
    int low = 1;
    int high = n;
    int ans = -1;
    while (low <= high) {
      int mid = (low + high) / 2;
      if (query(mid) > num) {
        ans = mid;
        high = mid - 1;
      } else {
        low = mid + 1;
      }
    }
    res[i] = ans - 1;
    update(ans, -1);
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", res[i]);
  }
  printf("\n");
}
