#include <bits/stdc++.h>
using namespace std;
const long long nInf = -1000000000;
const long long pInf = 1000000000;
const long long mod = 1000000007;
const int MAXN = 2e5 + 10;
void getdata();
void preproc();
void solve();
void build();
void update(int x, int delta);
int getsum(int l, int r);
int getsum(int r);
int n;
int p[MAXN];
int pp[MAXN];
int pq[MAXN];
int q[MAXN];
int r[MAXN];
int lessp[MAXN];
int lessq[MAXN];
int lessr[MAXN];
int tree[MAXN];
int res[MAXN];
int main() {
  int t = 1;
  for (int i = 0; i < t; i++) {
    getdata();
    preproc();
    solve();
  }
  return 0;
}
void getdata() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int c;
    scanf("%d ", &c);
    p[c] = 1;
    pp[i] = c;
    update(c, 1);
    int am = getsum(c - 1);
    lessp[i] = c - am;
  }
  build();
  for (int i = 0; i < n; i++) {
    int c;
    scanf("%d ", &c);
    q[c] = 1;
    pq[i] = c;
    update(c, 1);
    int am = getsum(c - 1);
    lessq[i] = c - am;
  }
}
void preproc() {}
void solve() {
  build();
  int f = 0;
  int las = n - 1;
  int rem = 0;
  for (int i = n - 1; i >= 0; i--) {
    int num = (lessp[i] + lessq[i] + rem) % (n - i);
    r[i] = num;
    if ((lessp[i] + lessq[i] + rem) / (n - i) > 0)
      rem = 1;
    else
      rem = 0;
  }
  for (int i = 0; i < n; i++) {
    int num = r[i];
    int l = f;
    int r1 = las;
    while (l < r1) {
      int med = (l + r1) / 2;
      int am = getsum(med);
      if (med - am < num) {
        l = med + 1;
      } else {
        r1 = med;
      }
    }
    res[i] = l;
    update(l, 1);
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", res[i]);
  }
  printf("\n");
}
void build() { fill(tree, tree + n, 0); }
void update(int x, int delta) {
  for (int i = x; i < n; i = i | (i + 1)) tree[i] += delta;
}
int getsum(int r) {
  int sum = 0;
  for (int i = r; i >= 0; i = (i & (i + 1)) - 1) sum += tree[i];
  return sum;
}
int getsum(int l, int r) {
  int sum = 0;
  sum += getsum(r) - getsum(l - 1);
  return sum;
}
