#include <bits/stdc++.h>
using namespace std;
int m, x, y;
int a[200100];
int b[200100];
int ans[200100];
priority_queue<pair<int, int> > aa;
priority_queue<pair<int, int> > bb;
int main() {
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%d", &a[i]);
    aa.push(pair<int, int>(a[i], i));
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &b[i]);
    bb.push(pair<int, int>(-b[i], i));
  }
  for (int i = 0; i < m; i++) {
    x = aa.top().first;
    y = bb.top().second;
    aa.pop();
    bb.pop();
    ans[y] = x;
  }
  for (int i = 0; i < m; i++) {
    printf("%d ", ans[i]);
  }
  printf("\n");
  return 0;
}
