#include <bits/stdc++.h>
using namespace std;
inline void wait(double seconds) {
  double endtime = clock() + (seconds * CLOCKS_PER_SEC);
  while (clock() < endtime) {
    ;
  }
}
inline int fastIn() {
  register char c = 0;
  register int a = 0;
  while (c < 33) c = getchar();
  while (c > 33) {
    a = (a * 10) + (c - '0');
    c = getchar();
  }
  return a;
}
inline void myOut(int a) {
  if (a) {
    int v = a % 10;
    myOut(a / 10);
    putchar((char)(v + '0'));
  }
}
inline void fastOut(int a) {
  if (a == int(0)) {
    putchar('0');
  } else if (a < int(0)) {
    putchar('-');
    myOut(-a);
  } else {
    myOut(a);
  }
}
const int mx = (int)1e5 + 10;
int n;
int A[mx], B[mx], C[mx];
inline void solve() {
  n = fastIn();
  for (int i = 1, j1 = n + 1; i < j1; ++i) A[i] = fastIn();
  for (int i = 1, j1 = n + 1; i < j1; ++i) B[i] = fastIn();
  for (int i = 1, j1 = n + 1; i < j1; ++i) C[B[i]] = A[i];
  for (int i = 1, j1 = n + 1; i < j1; ++i) fastOut(C[A[i]]), putchar(' ');
  puts("");
}
int main() {
  int kase = 1;
  for (int i = 0, j1 = kase; i < j1; ++i) {
    solve();
  }
  return 0;
}
