#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  vector<int> v1(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  for (int i = 0; i < n; i++) cin >> v1[i];
  vector<pair<int, int>> p;
  for (int i = 0; i < n; i++) {
    p.push_back(make_pair(v[i], v1[i]));
  }
  sort(p.begin(), p.end());
  for (int i = 0; i < n; i++) cout << p[i].second << " ";
  cout << endl;
  return 0;
}
