#include <bits/stdc++.h>
using namespace std;
int lowbit(int x) { return x & (-x); }
int n;
int tree_size;
int tree[200005];
void clean();
void add(int pos, int val);
int query(int pos);
int a[200005], b[200005], c[200005], a_value[200005], b_value[200005],
    c_value[200005];
void solve(int a[], int a_value[]) {
  tree_size = n;
  clean();
  for (int i = 1; i <= n; i++) add(i, 1);
  for (int i = 1; i <= n; i++) {
    a_value[i] = query(a[i]);
    add(a[i] + 1, -1);
  }
}
int get_value_from_tree(int value) {
  int l, r, mid;
  l = 1;
  r = tree_size;
  while (l != r) {
    mid = (l + r) >> 1;
    int now = query(mid);
    if (now > value) {
      r = mid - 1;
    } else if (now < value) {
      l = mid + 1;
    } else if (query(mid - 1) == value) {
      r = mid - 1;
    } else {
      return mid - 1;
    }
  }
  return l - 1;
}
void build(int a[], int a_value[]) {
  tree_size = n;
  clean();
  for (int i = 1; i <= n; i++) add(i, 1);
  for (int i = 1; i <= n; i++) {
    a[i] = get_value_from_tree(a_value[i] + 1);
    add(a[i] + 1, -1);
  }
}
void show(int a[]) {
  for (int i = 1; i <= n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
}
int main() {
  int i, j, k;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  solve(a, a_value);
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
  }
  solve(b, b_value);
  for (i = 1; i <= n; i++) {
    c_value[i] = a_value[i] + b_value[i];
  }
  for (i = n - 1, j = 2; i >= 1; i--, j++) {
    c_value[i - 1] += c_value[i] / j;
    c_value[i] %= j;
  }
  build(c, c_value);
  for (int i = 1; i <= n; i++) {
    cout << c[i] << " ";
  }
  cout << endl;
  return 0;
}
void clean() { memset(tree, 0, sizeof(tree)); }
void add(int pos, int val) {
  while (pos <= tree_size) {
    tree[pos] += val;
    pos += lowbit(pos);
  }
}
int query(int pos) {
  int ret = 0;
  while (pos > 0) {
    ret += tree[pos];
    pos -= lowbit(pos);
  }
  return ret;
}
