#include <bits/stdc++.h>
using namespace std;
struct str {
  int a, b;
} x[100010];
bool cmp(const str &q1, const str &q2) { return q1.a < q2.a; }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &x[i].a);
  for (int i = 1; i <= n; i++) scanf("%d", &x[i].b);
  sort(x + 1, x + 1 + n, cmp);
  for (int i = 1; i < n; i++) printf("%d ", x[i].b);
  printf("%d\n", x[n].b);
}
