#include <bits/stdc++.h>
using namespace std;
int a[3010][3010], b[3010][3010];
string upperCase(const string& s) {
  string upper(s);
  for (size_t i = 1; i < s.length(); ++i) upper[i] = toupper(upper[i]);
  return upper;
}
inline string lowerCase(const string& s) {
  string lower(s);
  for (size_t i = 0; i < s.length(); ++i) lower[i] = tolower(lower[i]);
  return lower;
}
int main() {
  int n;
  cin >> n;
  vector<int> v1(n + 1, 0);
  vector<int> v2;
  vector<int> it(n + 1, 0);
  int tmp;
  for (int i = 1; i <= n; i++) {
    cin >> tmp;
    v1[tmp] = i;
  }
  v2.push_back(0);
  for (int i = 1; i <= n; i++) {
    cin >> tmp;
    v2.push_back(tmp);
  }
  for (int i = 1; i <= n; i++) {
    if (v2[i] == i) {
      it[i] = v1[i];
    } else {
      it[i] = v1[v2[i]];
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << it[i] << " ";
  }
  return 0;
}
