#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 7;
const int mod = 1e9 + 7;
const int INF = 1e9 + 7;
const int mlog = 20;
const int SQ = 400;
int seg[4 * maxn];
int a[maxn], A[maxn];
int b[maxn], B[maxn];
int x[maxn];
int n;
void add(int id, int L = 0, int R = n, int idx = 1) {
  seg[idx]++;
  if (L == R - 1) return;
  int mid = (L + R) >> 1;
  if (id < mid)
    add(id, L, mid, idx * 2 + 0);
  else
    add(id, mid, R, idx * 2 + 1);
}
int get(int l, int r, int L = 0, int R = n, int idx = 1) {
  if (l == L and r == R) return seg[idx];
  int mid = (L + R) >> 1;
  int sum = 0;
  if (l < mid) sum += get(l, min(mid, r), L, mid, idx * 2 + 0);
  if (r > mid) sum += get(max(l, mid), r, mid, R, idx * 2 + 1);
  return sum;
}
int Get(int val, int L = 0, int R = n, int idx = 1) {
  if (L == R - 1) return L;
  int mid = (L + R) >> 1;
  if (mid - L - seg[idx * 2] > val)
    return Get(val, L, mid, idx * 2 + 0);
  else
    return Get(val - (mid - L - seg[idx * 2]), mid, R, idx * 2 + 1);
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(), cout.tie();
  ;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  for (int i = 0; i < n; i++) A[n - 1 - i] = a[i] - get(0, a[i]), add(a[i]);
  memset(seg, 0, sizeof seg);
  for (int i = 0; i < n; i++) B[n - 1 - i] = b[i] - get(0, b[i]), add(b[i]);
  for (int i = 0; i < n; i++) {
    A[i] += B[i];
    if (A[i] > i) A[i] -= i + 1, A[i + 1]++;
  }
  memset(seg, 0, sizeof seg);
  for (int i = n - 1; i >= 0; i--) {
    x[i] = Get(A[i]);
    add(x[i]);
  }
  for (int i = n - 1; i >= 0; i--) cout << x[i] << " ";
  cout << endl;
  return 0;
}
