#include <bits/stdc++.h>
using namespace std;
long long modulo(long long base, long long exponent, long long modulus);
long long choose(long long n, long long k);
long long inverse(long long a, long long m);
void build() {}
void update(long long node, long long nl, long long nr, vector<long long> &tree,
            long long ind, long long ele) {
  if (nl == nr) {
    tree[node] = ele;
    return;
  }
  long long mid = (nl + nr) / 2;
  if (nl <= ind && ind <= mid)
    update(2 * node + 1, nl, mid, tree, ind, ele);
  else
    update(2 * node + 2, mid + 1, nr, tree, ind, ele);
  tree[node] = tree[2 * node + 1] + tree[2 * node + 2];
}
long long querry(long long node, long long nl, long long nr,
                 vector<long long> &tree, long long l, long long r) {
  if (nl > nr || l > r || nl > r || l > nr) return 0;
  if (l <= nr && nr <= r) return tree[node];
  long long mid = (nl + nr) / 2;
  long long p1 = querry(2 * node + 1, nl, mid, tree, l, r);
  long long p2 = querry(2 * node + 2, mid + 1, nr, tree, l, r);
  return p1 + p2;
}
void print(vector<long long> &a) {
  for (int i = 0; i < a.size(); i++) cout << a[i] << " ";
  cout << endl;
}
long long get(long long x, long long n, vector<long long> &tree) {
  long long low = 0, high = n - 1;
  long long ans = 0;
  while (low <= high) {
    long long mid = (low + high) / 2;
    long long comp = querry(0, 0, n - 1, tree, 0, mid);
    if (comp >= (x + 1)) {
      ans = mid;
      high = mid - 1;
    } else {
      low = mid + 1;
    }
  }
  update(0, 0, n - 1, tree, ans, 0);
  return ans;
}
int main() {
  build();
  long long n;
  scanf("%lld", &n);
  vector<long long> a(n), b(n);
  for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
  for (int i = 0; i < n; i++) scanf("%lld", &b[i]);
  vector<long long> tree(4 * n);
  vector<long long> cona(n), conb(n);
  for (int i = 0; i < n; i++) update(0, 0, n - 1, tree, i, 1);
  for (int i = 0; i < n; i++) {
    long long rank = querry(0, 0, n - 1, tree, 0, a[i] - 1);
    cona[i] = rank;
    update(0, 0, n - 1, tree, a[i], 0);
  }
  for (int i = 0; i < n; i++) update(0, 0, n - 1, tree, i, 1);
  for (int i = 0; i < n; i++) {
    long long rank = querry(0, 0, n - 1, tree, 0, b[i] - 1);
    conb[i] = rank;
    update(0, 0, n - 1, tree, b[i], 0);
  }
  vector<long long> summed(n);
  long long carry = 0;
  for (int i = n - 1; i >= 0; i--) {
    long long sum = cona[i] + conb[i] + carry;
    long long lim = n - i - 1;
    if (sum > lim) {
      summed[i] = sum - (lim + 1);
      carry = 1;
    } else {
      summed[i] = sum;
      carry = 0;
    }
  }
  for (int i = 0; i < n; i++) update(0, 0, n - 1, tree, i, 1);
  vector<long long> ans(n);
  for (int i = 0; i < n; i++) {
    long long ele = get(summed[i], n, tree);
    ans[i] = ele;
  }
  for (int i = 0; i < n; i++) printf("%lld ", ans[i]);
  return 0;
}
long long modulo(long long base, long long exponent, long long modulus) {
  if (modulus == 1) return 0;
  long long result = 1;
  base = base % modulus;
  while (exponent > 0) {
    if (exponent % 2 == 1) {
      result = (result * base) % modulus;
    }
    exponent = exponent >> 1;
    base = (base * base) % modulus;
  }
  return result;
}
long long choose(long long n, long long k) {
  if (k == 0) return 1;
  return (n * choose(n - 1, k - 1)) / k;
}
void EE(long long a, long long b, long long &co1, long long &co2) {
  if (a % b == 0) {
    co1 = 0;
    co2 = 1;
    return;
  }
  EE(b, a % b, co1, co2);
  long long temp = co1;
  co1 = co2;
  co2 = temp - co2 * (a / b);
}
long long inverse(long long a, long long m) {
  long long x, y;
  EE(a, m, x, y);
  if (x < 0) x += m;
  return x;
}
