#include <bits/stdc++.h>
using namespace std;
long n, m, q, ar1[200000], ara[200000], ar2[200000], par[200000];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> q;
    ar1[q] = i;
  }
  for (int i = 1; i <= n; i++) {
    cin >> q;
    ar2[q] = i;
  }
  for (int i = 1; i <= n; i++) {
    par[ar2[i]] = ar1[i];
  }
  for (int i = 1; i <= n; i++) {
    if (i > 1) cout << " ";
    cout << par[i];
  }
  cout << endl;
  for (int t = 1; t <= 2; t++)
    for (int i = 1; i <= n; i++) {
      ar1[i] = par[ar1[i]];
    }
  for (int i = 1; i <= n; i++) ara[ar1[i]] = i;
  cin.get();
  cin.get();
  return 0;
}
