#include <bits/stdc++.h>
using namespace std;
long long int x, y;
long long int gcd(long long int a, long long int b) {
  if (a == 0) {
    x = 0, y = 1;
    return b;
  }
  long long int gc = gcd(b % a, a);
  long long int temp;
  temp = x;
  x = y - (b / a) * temp;
  y = temp;
  return gc;
}
int p1[1000005], p2[1000005];
int v1[1000005], v2[1000005], v3[1000005];
int seg[1000005];
set<int> t;
void build(int node, int start, int end, int k) {
  if (start == end) {
    seg[node] = k;
    return;
  }
  int mid = (start + end) >> 1;
  build(2 * node + 1, start, mid, k);
  build(2 * node + 2, mid + 1, end, k);
  seg[node] = seg[2 * node + 1] + seg[2 * node + 2];
}
void update(int node, int start, int end, int val, int k) {
  if (start == end) {
    seg[node] = k;
    return;
  }
  int mid = (start + end) >> 1;
  if (val <= mid) {
    update(2 * node + 1, start, mid, val, k);
  } else
    update(2 * node + 2, mid + 1, end, val, k);
  seg[node] = seg[2 * node + 1] + seg[2 * node + 2];
}
void print(int node, int start, int end) {
  if (start == end) {
    cout << start << " " << seg[node] << endl;
    return;
  }
  int mid = (start + end) >> 1;
  print(2 * node + 1, start, mid);
  print(2 * node + 2, mid + 1, end);
  cout << start << " " << end << " " << seg[node] << endl;
}
int query(int node, int start, int end, int t) {
  if (start == end) {
    return start;
  }
  int mid = (start + end) >> 1;
  if (t <= seg[2 * node + 1]) {
    return query(2 * node + 1, start, mid, t);
  }
  return query(2 * node + 2, mid + 1, end, t - seg[2 * node + 1]);
}
int query1(int node, int start, int end, int t) {
  if (start > t) return 0;
  if (end <= t) return seg[node];
  int mid = (start + end) >> 1;
  return query1(2 * node + 1, start, mid, t) +
         query1(2 * node + 2, mid + 1, end, t);
}
int main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  int n;
  cin >> n;
  int i;
  for (i = 0; i < n; i++) {
    cin >> p1[i];
  }
  for (i = 0; i < n; i++) {
    cin >> p2[i];
  }
  int p;
  build(0, 0, n - 1, 0);
  for (i = 0; i < n; i++) {
    p = query1(0, 0, n - 1, p1[i]);
    v1[i] = p1[i] - p;
    update(0, 0, n - 1, p1[i], 1);
  }
  build(0, 0, n - 1, 0);
  for (i = 0; i < n; i++) {
    p = query1(0, 0, n - 1, p2[i]);
    v2[i] = p2[i] - p;
    update(0, 0, n - 1, p2[i], 1);
  }
  p = 0;
  for (i = n - 1; i >= 0; i--) {
    v3[i] = v1[i] + v2[i] + p;
    if (v3[i] >= n - i) {
      p = 1;
      v3[i] = v3[i] % (n - i);
    } else
      p = 0;
  }
  build(0, 0, n - 1, 1);
  for (i = 0; i < n; i++) {
    p = query(0, 0, n - 1, v3[i] + 1);
    cout << p << " ";
    update(0, 0, n - 1, p, 0);
  }
}
