#include <bits/stdc++.h>
using namespace std;
struct node {
  int val;
  node *l;
  node *r;
  int lc;
  int ex;
};
node *construct(int l, int r) {
  int m = (l + r) / 2;
  node *res = new node;
  res->val = m;
  res->ex = 1;
  if (l < m) {
    res->l = construct(l, m - 1);
  } else {
    res->l = NULL;
  }
  res->lc = m - l;
  if (r > m) {
    res->r = construct(m + 1, r);
  } else {
    res->r = NULL;
  }
  return res;
}
int a[200000];
int b[200000];
node *na, *nb;
int fad(node *n, int x) {
  if (n->val == x) {
    n->ex = 0;
    return n->lc;
  }
  if (n->val > x) {
    n->lc--;
    return fad(n->l, x);
  }
  return n->lc + n->ex + fad(n->r, x);
}
int fiad(node *n, int x) {
  if (n->lc == x && n->ex) {
    n->ex = 0;
    return n->val;
  } else if (x < n->lc) {
    n->lc--;
    return fiad(n->l, x);
  }
  return fiad(n->r, x - n->lc - n->ex);
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, x;
  cin >> n;
  na = construct(0, n - 1);
  nb = construct(0, n - 1);
  for (int i = 0; i < n; i++) {
    cin >> x;
    a[i] = fad(na, x);
  }
  for (int i = 0; i < n; i++) {
    cin >> x;
    b[i] = fad(nb, x);
  }
  int carry = 0;
  for (int i = n - 1; i >= 0; i--) {
    int j = n - 1 - i;
    b[i] += a[i] + carry;
    if (b[i] > j) {
      b[i] -= j + 1;
      carry = 1;
    } else {
      carry = 0;
    }
  }
  nb = construct(0, n - 1);
  for (int i = 0; i < n; i++) {
    cout << fiad(nb, b[i]) << " ";
  }
  cout << endl;
  return 0;
}
