#include <bits/stdc++.h>
using namespace std;
int sg[524288];
int BIT[200002];
int n;
void add(int index, int value, int node = 1, int l = 0, int r = n - 1) {
  if (l == r) {
    sg[node]++;
    return;
  }
  if (index <= (l + r) / 2)
    add(index, value, node * 2, l, (l + r) / 2);
  else
    add(index, value, node * 2 + 1, (l + r) / 2 + 1, r);
  sg[node] = sg[node * 2] + sg[node * 2 + 1];
}
int get(int index, int node = 1, int l = 0, int r = n - 1) {
  if (l == r) return l;
  if (index <= sg[node * 2])
    return get(index, node * 2, l, (l + r) / 2);
  else
    return get(index - sg[node * 2], node * 2 + 1, (l + r) / 2 + 1, r);
}
void remove_(int index, int node = 1, int l = 0, int r = n - 1) {
  if (l == r) {
    sg[node]--;
    return;
  }
  if (index <= sg[node * 2])
    remove_(index, node * 2, l, (l + r) / 2);
  else
    remove_(index - sg[node * 2], node * 2 + 1, (l + r) / 2 + 1, r);
  sg[node] = sg[node * 2] + sg[node * 2 + 1];
}
void BIT_add(int index, int value) {
  while (index < 200002) {
    BIT[index] += value;
    index += (index & -index);
  }
}
int BIT_get(int index) {
  if (index <= 0) return 0;
  int ans = 0;
  while (index > 0) {
    ans += BIT[index];
    index -= (index & -index);
  }
  return ans;
}
vector<int> Ord(vector<int> A) {
  for (int i = 1; i < n + 1; i++) BIT_add(i, 1);
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    ans.push_back(BIT_get(A[i]));
    BIT_add(A[i] + 1, -1);
  }
  return ans;
}
int num;
int main() {
  memset(BIT, 0, sizeof BIT);
  memset(sg, 0, sizeof sg);
  vector<int> A, B;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &num);
    A.push_back(num);
  }
  A = Ord(A);
  memset(BIT, 0, sizeof BIT);
  for (int i = 0; i < n; i++) {
    scanf("%d", &num);
    B.push_back(num);
  }
  B = Ord(B);
  for (int i = 0; i < n; i++) A[i] += B[i];
  for (int i = n - 1; i > 0; i--) {
    int base = n - i;
    A[i - 1] += A[i] / base;
    A[i] %= base;
  }
  A[0] %= n;
  for (int i = 0; i < n; i++) add(i, i);
  for (int i = 0; i < A.size(); i++) {
    printf("%d ", get(A[i] + 1));
    remove_(A[i] + 1);
  }
}
