#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2e5 + 6;
int n, f;
int a[MAX_N], b[MAX_N], tree[MAX_N << 1 + 6];
void init() {
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  memset(tree, 0, sizeof(tree));
  f = 0;
}
void build(int id, int l, int r) {
  if (l == r) {
    tree[id] = 1;
    return;
  }
  int mid = (l + r >> 1);
  build(id << 1, l, mid);
  build(id << 1 | 1, mid + 1, r);
  tree[id] = tree[id << 1] + tree[id << 1 | 1];
}
void update(int id, int l, int r, int i, int value, int arr[]) {
  if (l == r) {
    tree[id] = 1;
    return;
  }
  int mid = (l + r >> 1);
  if (value > mid) {
    arr[i] += mid - l + 1 - tree[id << 1];
    update(id << 1 | 1, mid + 1, r, i, value, arr);
  } else {
    update(id << 1, l, mid, i, value, arr);
  }
  tree[id] = tree[id << 1] + tree[id << 1 | 1];
}
void search(int arr[], int id, int l, int r, int value, int i) {
  if (l == r) {
    tree[id] = 0;
    arr[i] = l;
    return;
  }
  int mid = (l + r >> 1);
  if (value <= tree[id << 1]) {
    search(arr, id << 1, l, mid, value, i);
  } else {
    search(arr, id << 1 | 1, mid + 1, r, value - tree[id << 1], i);
  }
  tree[id] = tree[id << 1] + tree[id << 1 | 1];
}
int main() {
  while (cin >> n) {
    int x;
    init();
    for (int i = 1; i <= n; i++) {
      cin >> x;
      update(1, 0, n - 1, i, x, a);
    }
    memset(tree, 0, sizeof(tree));
    for (int i = 1; i <= n; i++) {
      cin >> x;
      update(1, 0, n - 1, i, x, b);
    }
    for (int i = n - 1, t = 1; i > 1; i--, t++) {
      a[i] = a[i] + b[i] + f;
      f = (a[i] / (t + 1));
      a[i] = (a[i] % (t + 1));
    }
    a[1] = (a[1] + b[1] + f) % n;
    build(1, 0, n - 1);
    for (int i = 1; i <= n; i++) {
      search(a, 1, 0, n - 1, a[i] + 1, i);
      cout << a[i] << ((i == n) ? "" : " ");
    }
    cout << endl;
  }
  return 0;
}
