#include <bits/stdc++.h>
using namespace std;
long long n, a[100200], b[100200], c, v;
map<int, int> mp;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
  }
  for (int i = 1; i <= n; i++) {
    mp.insert(make_pair(a[i], b[i]));
  }
  for (auto po = mp.begin(); po != mp.end(); po++) {
    cout << po->second << " ";
  }
}
