#include <bits/stdc++.h>
using namespace std;
int Tree[200005 * 4], Z[200005];
int X[200005], Y[200005], A[200005], B[200005];
void build(int node, int l, int r) {
  if (l == r)
    Tree[node] = 1;
  else {
    int MID = (l + r) >> 1;
    build(node * 2, l, MID);
    build(node * 2 + 1, MID + 1, r);
    Tree[node] = Tree[node * 2] + Tree[node * 2 + 1];
  }
}
int update(int node, int l, int r, int k) {
  if (l == r) {
    Tree[node] = 0;
    return l;
  }
  int x, MID = (l + r) >> 1;
  if (Tree[node * 2] > k)
    x = update(node * 2, l, MID, k);
  else
    x = update(node * 2 + 1, MID + 1, r, k - Tree[node * 2]);
  Tree[node] = Tree[node * 2] + Tree[node * 2 + 1];
  return x;
}
int query(int node, int l, int r, int a, int b) {
  if (l > r || a > r || b < l || a > b) return 0;
  if (a <= l && b >= r) return Tree[node];
  int MID = (l + r) >> 1;
  int x = query(node * 2, l, MID, a, b) + query(node * 2 + 1, MID + 1, r, a, b);
  Tree[node] = Tree[node * 2] + Tree[node * 2 + 1];
  return x;
}
void f(int node, int l, int r, int x) {
  if (x < l || x > r) return;
  if (l == r && l == x) {
    Tree[node] = 0;
    return;
  }
  int MID = (l + r) >> 1;
  if (x <= MID)
    f(node * 2, l, MID, x);
  else
    f(node * 2 + 1, MID + 1, r, x);
  Tree[node] = Tree[node * 2] + Tree[node * 2 + 1];
}
void H(int n) {
  build(1, 0, n - 1);
  for (int i = 0; i < n; i++) {
    X[i] = query(1, 0, n - 1, 0, A[i]) - 1;
    f(1, 0, n - 1, A[i]);
  }
  memset(Tree, 0, sizeof Tree);
  build(1, 0, n - 1);
  for (int i = 0; i < n; i++) {
    Y[i] = query(1, 0, n - 1, 0, B[i]) - 1;
    f(1, 0, n - 1, B[i]);
  }
  memset(Tree, 0, sizeof Tree);
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i];
  for (int i = 0; i < n; i++) cin >> B[i];
  H(n);
  int carry = 0;
  for (int i = n - 1; i >= 0; i--) {
    Z[i] = (X[i] + Y[i] + carry) % (n - i);
    carry = (X[i] + Y[i] + carry) / (n - i);
  }
  build(1, 0, n - 1);
  for (int i = 0; i < n; i++) {
    int x = update(1, 0, n - 1, Z[i]);
    cout << x << " ";
  }
  return 0;
}
