#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using namespace std;
const int MAXN = 200001;
pair<int, int> a[MAXN], b[MAXN];
int ans[MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  cout.setf(ios::fixed);
  cout.precision(20);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i].first, a[i].second = i;
  for (int i = 0; i < n; i++) cin >> b[i].first, b[i].second = i;
  sort(a, a + n);
  sort(b, b + n);
  for (int i = 0; i < n; i++) ans[b[i].second] = a[n - 1 - i].first;
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  cout << "\n";
  return 0;
}
