#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr1[n];
  for (int i = 0; i < n; i++) cin >> arr1[i];
  int arr2[n];
  for (int i = 0; i < n; i++) cin >> arr2[i];
  unordered_map<int, int> m1;
  unordered_map<int, int> m2;
  for (int i = 0; i < n; i++) {
    m1[arr1[i] - 1] = i;
  }
  for (int i = 0; i < n; i++) {
    m2[arr2[i] - 1] = i;
  }
  unordered_map<int, int> link;
  for (int i = 0; i < n; i++) {
    link[m1[i]] = m2[i];
  }
  for (int i = 0; i < n; i++) {
    cout << arr1[link[i]] << " ";
  }
}
