#include <bits/stdc++.h>
using namespace std;
const int MAX = 200000;
int tree[MAX + 5];
void update(int i, int val) {
  while (i <= MAX) {
    tree[i] += val;
    i += (i & -i);
  }
}
int find(int i) {
  int res = 0;
  while (i) {
    res += tree[i];
    i -= (i & -i);
  }
  return res;
}
int kth(int k) {
  int s = 1, e = MAX, ret = e;
  while (s <= e) {
    int mid = (s + e) >> 1;
    if (find(mid) >= k)
      ret = mid, e = mid - 1;
    else
      s = mid + 1;
  }
  return ret;
}
int a[MAX + 5];
int p[MAX + 5], q[MAX + 5];
int n;
void getFact(int a[], int p[]) {
  memset(tree, 0, sizeof(tree));
  for (int i = 1; i <= n; ++i) update(i, 1);
  for (int i = 0; i < n; ++i) {
    update(a[i] + 1, -1);
    p[i] = find(a[i] + 1);
  }
}
void revFact(int a[], int p[]) {
  memset(tree, 0, sizeof(tree));
  for (int i = 1; i <= n; ++i) update(i, 1);
  for (int i = 0; i < n; ++i) {
    a[i] = kth(p[i] + 1) - 1;
    update(a[i] + 1, -1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  getFact(a, p);
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  getFact(a, q);
  int carry = 0;
  for (int i = n - 1; i >= 0; --i) {
    int sum = p[i] + q[i] + carry;
    p[i] = sum % (n - i);
    carry = sum / (n - i);
  }
  revFact(a, p);
  for (int i = 0; i < n; ++i) printf("%d ", a[i]);
}
