#include <bits/stdc++.h>
using namespace std;
long long n, t, c[1010101];
vector<pair<long long, long long> > a, b;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> t;
    a.push_back({t, i});
  }
  for (long long i = 0; i < n; i++) {
    cin >> t;
    b.push_back({t, i});
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  for (long long i = 0; i < n; i++) {
    c[b[i].second] = a[n - 1 - i].first;
  }
  for (long long i = 0; i < n; i++) {
    cout << c[i] << " ";
  }
  cout << '\n';
  return 0;
}
