#include <bits/stdc++.h>
using namespace std;
int a[1000010], b[1000010], c[1000010];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) scanf("%d", &b[i]);
  for (int i = 0; i < n; i++) c[b[i]] = a[i];
  for (int i = 0; i < n; i++) printf("%d ", c[a[i]]);
  return 0;
}
