#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
template <class T>
inline T sqr(T a) {
  return a * a;
}
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > a(n);
  vector<pair<int, int> > b;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i].second);
    a[i].first = i;
    a[i].second--;
  }
  for (int i = 0; i < n; ++i) {
    int u;
    scanf("%d", &u);
    b.push_back(make_pair(i, u - 1));
  }
  sort(b.begin(), b.end());
  sort(a.begin(), a.end());
  vector<int> res(n);
  for (int i = 0; i < n; ++i) {
    res[a[i].second] = b[i].second;
  }
  for (int i = 0; i < n; ++i) printf("%d ", res[i] + 1);
  return 0;
}
