#include <bits/stdc++.h>
using namespace std;
long long n, m, ans, k, i;
pair<long long, long long> a[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> k;
    a[i].first = k;
  }
  for (i = 1; i <= n; i++) {
    cin >> k;
    a[i].second = k;
  }
  sort(a + 1, a + 1 + n);
  for (i = 1; i <= n; i++) {
    cout << a[i].second << " ";
  }
  cout << endl;
  return 0;
}
