#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
class SegTree {
 private:
  int N;
  long long *segTree, *lazy;
  bool *propaga;
  void change(int, int, int, int, int, long long);
  long long merge(long long, long long);
  void to_propagate(int pos, int a, int b, int l, int r) {
    if (propaga[pos]) {
      int mid = (a + b) >> 1;
      change(2 * pos, a, mid, l, r, lazy[pos]);
      change(2 * pos + 1, mid + 1, b, l, r, lazy[pos]);
      propaga[pos] = false;
    }
  }
  long long st_search(int pos, int a, int b, int l, int r) {
    if (l <= a && b <= r) return segTree[pos];
    long long med = (a + b) >> 1, res;
    to_propagate(pos, a, b, l, r);
    if (l <= med && r > med)
      res = merge(st_search(2 * pos, a, med, l, r),
                  st_search(2 * pos + 1, med + 1, b, l, r));
    if (r <= med) res = st_search(2 * pos, a, med, l, r);
    if (l > med) res = st_search(2 * pos + 1, med + 1, b, l, r);
    segTree[pos] = merge(segTree[2 * pos], segTree[2 * pos + 1]);
    return res;
  }
  void st_update(int pos, int a, int b, int l, int r, long long v) {
    if (l <= a && b <= r) return change(pos, a, b, l, r, v);
    long long med = (a + b) >> 1;
    to_propagate(pos, a, b, l, r);
    if (l <= med) st_update(2 * pos, a, med, l, r, v);
    if (r > med) st_update(2 * pos + 1, med + 1, b, l, r, v);
    segTree[pos] = merge(segTree[2 * pos], segTree[2 * pos + 1]);
  }
  void init(int *v, int pos, int a, int b) {
    propaga[pos] = false;
    if (a == b) {
      segTree[pos] = v[a];
    } else {
      int med = (a + b) >> 1;
      init(v, 2 * pos, a, med);
      init(v, 2 * pos + 1, med + 1, b);
      segTree[pos] = merge(segTree[2 * pos], segTree[2 * pos + 1]);
    }
  }

 public:
  SegTree(int *v, int _n) {
    N = _n;
    segTree = new long long[4 * N];
    lazy = new long long[4 * N];
    propaga = new bool[4 * N];
    init(v, 1, 0, N - 1);
  }
  SegTree(int _n) {
    N = _n;
    segTree = new long long[4 * N];
    lazy = new long long[4 * N];
    propaga = new bool[4 * N];
    memset(segTree, 0, sizeof segTree);
    memset(propaga, 0, sizeof propaga);
  }
  ~SegTree() {
    delete[] propaga;
    delete[] segTree;
    delete[] lazy;
  }
  long long search(int l, int r) { return st_search(1, 0, N - 1, l, r); }
  void update(int l, int r, long long v) { st_update(1, 0, N - 1, l, r, v); }
};
long long SegTree::merge(long long v1, long long v2) { return v1 + v2; }
void SegTree::change(int pos, int a, int b, int l, int r, long long v) {
  segTree[pos] += v * (b - a + 1);
  if (propaga[pos]) {
    lazy[pos] += v;
  } else {
    lazy[pos] = v, propaga[pos] = true;
  }
}
int v[MAXN];
int p1[MAXN], p2[MAXN];
int x[MAXN], y[MAXN];
int vr[MAXN];
int n;
int search(int val, SegTree &s) {
  int inf = 0, sup = n - 1;
  while (inf < sup) {
    int med = (inf + sup) >> 1;
    if (s.search(0, med) >= val) {
      sup = med;
    } else {
      inf = med + 1;
    }
  }
  return sup;
}
int main() {
  for (int i = 0; i < MAXN; ++i) v[i] = 1;
  while (cin >> n) {
    for (int i = 0; i < n; ++i) cin >> p1[i];
    for (int i = 0; i < n; ++i) cin >> p2[i];
    SegTree st1(v, n), st2(v, n);
    for (int i = 0; i < n; ++i) {
      st1.update(p1[i], p1[i], -1), st2.update(p2[i], p2[i], -1);
      x[i] = st1.search(0, p1[i]), y[i] = st2.search(0, p2[i]);
    }
    long long carry = 0;
    for (int i = 0; i < n; ++i) {
      long long tmp = x[n - i - 1] + y[n - i - 1] + carry;
      vr[n - i - 1] = tmp % (i + 1);
      carry = tmp / (i + 1);
    }
    SegTree stf(v, n);
    for (int i = 0; i < n; ++i) {
      int x = search(vr[i] + 1, stf);
      cout << x << " ";
      stf.update(x, x, -1);
    }
    cout << endl;
  }
}
