#include <bits/stdc++.h>
using namespace std;
long long int MOD = 1e9 + 7;
void solve() {
  long long int n;
  cin >> n;
  long long int a[n + 1], b[n + 1];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  for (long long int i = 0; i < n; i++) cin >> b[i];
  long long int c[n + 1];
  for (long long int i = 0; i < n; i++) c[b[i]] = a[i];
  for (long long int i = 0; i < n; i++) cout << c[a[i]] << " ";
}
int main() {
  long long int t = 1;
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  for (long long int g = 1; g <= t; g++) {
    solve();
  }
}
