#include <bits/stdc++.h>
using namespace std;
const int N = 200100;
struct Node {
  int x, id;
  bool operator<(const Node& a) const { return x < a.x; }
} a[N], b[N];
int n, seq[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i].x), a[i].id = i;
  for (int i = 1; i <= n; i++) scanf("%d", &b[i].x), b[i].id = i;
  sort(a + 1, a + n + 1);
  sort(b + 1, b + n + 1);
  for (int i = 1; i <= n; i++) seq[b[i].id] = a[n - i + 1].x;
  for (int i = 1; i <= n; i++) printf("%d ", seq[i]);
  return 0;
}
