#include <bits/stdc++.h>
using namespace std;
struct point {
  long b, i;
};
bool cmp(point A, point B) { return A.b < B.b; }
long BS(point P[], long n, long val) {
  long b = 0, e = n;
  long mid = (b + e) / 2;
  while (b <= e) {
    mid = (b + e) / 2;
    if (P[mid].b == val) {
      return P[mid].i;
    } else if (P[mid].b < val) {
      b = mid + 1;
    } else
      e = mid - 1;
  }
}
int main() {
  long n;
  cin >> n;
  point P[n];
  long c[n], a[n], ans[n];
  for (long i = 0; i < n; i++) {
    cin >> P[i].b;
    P[i].i = i;
  }
  for (long i = 0; i < n; i++) cin >> c[i];
  sort(P, P + n, cmp);
  for (long i = 0; i < n; i++) {
    long x = BS(P, n, c[i]);
    a[x] = i;
  }
  for (long i = 0; i < n; i++) {
    ans[a[i]] = i + 1;
  }
  for (long i = 0; i < n; i++) cout << ans[i] << " ";
  cout << "\n";
  return 0;
}
