#include <bits/stdc++.h>
const int MAX_N = 200000 + 5;
int tree[MAX_N * 8];
int a[MAX_N], b[MAX_N];
int num_a[MAX_N], num_b[MAX_N];
void Build(int root, int l, int r, int val) {
  if (l == r) {
    tree[root] = val;
    return;
  }
  int mid = l + (r - l) / 2;
  Build(root * 2, l, mid, val);
  Build(root * 2 + 1, mid + 1, r, val);
  tree[root] = tree[root * 2] + tree[root * 2 + 1];
}
void Modify(int root, int l, int r, int x, int val) {
  if (l == r) {
    tree[root] += val;
    return;
  }
  int mid = l + (r - l) / 2;
  if (x <= mid)
    Modify(root * 2, l, mid, x, val);
  else
    Modify(root * 2 + 1, mid + 1, r, x, val);
  tree[root] = tree[root * 2] + tree[root * 2 + 1];
}
int CountLess(int root, int l, int r, int x) {
  if (x >= r) return tree[root];
  if (x < l) return 0;
  int mid = l + (r - l) / 2;
  return CountLess(root * 2, l, mid, x) +
         CountLess(root * 2 + 1, mid + 1, r, x);
}
int FindKth(int root, int l, int r, int k) {
  if (l == r) return l;
  int mid = l + (r - l) / 2;
  if (k <= tree[root * 2])
    return FindKth(root * 2, l, mid, k);
  else
    return FindKth(root * 2 + 1, mid + 1, r, k - tree[root * 2]);
}
void Transform(int a[], int num[], int n) {
  Build(1, 0, n - 1, 0);
  for (int i = n - 1; i >= 0; i--) {
    num[i] = CountLess(1, 0, n - 1, a[i]);
    Modify(1, 0, n - 1, a[i], 1);
  }
}
void Transfrom_back(int num[], int a[], int n) {
  Build(1, 0, n - 1, 1);
  for (int i = 0; i < n; i++) {
    a[i] = FindKth(1, 0, n - 1, num[i] + 1);
    Modify(1, 0, n - 1, a[i], -1);
  }
}
void Add(int a[], int b[], int n) {
  int carry = 0;
  for (int i = n - 1; i >= 0; i--) {
    a[i] += b[i] + carry;
    carry = a[i] / (n - i);
    a[i] %= (n - i);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int j = 0; j < n; j++) scanf("%d", &b[j]);
  Transform(a, num_a, n);
  Transform(b, num_b, n);
  Add(num_a, num_b, n);
  Transfrom_back(num_a, a, n);
  for (int i = 0; i < n; i++) printf("%d ", a[i]);
  printf("\n");
  return 0;
}
