#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
int ans[maxn], n, t[maxn];
struct node {
  int x, id;
  bool operator<(const node& tt) const { return x < tt.x; }
} a[maxn], b[maxn];
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 0; i < n; i++) {
      scanf("%d", &a[i].x);
      a[i].id = i + 1;
      t[i] = a[i].x;
    }
    for (int i = 0; i < n; i++) {
      scanf("%d", &b[i].x);
      b[i].id = i + 1;
    }
    sort(a, a + n);
    sort(b, b + n);
    for (int i = 0; i < n; i++) {
      int x = a[i].id;
      int y = b[i].id;
      x--;
      y--;
      ans[x] = t[y];
    }
    for (int i = 0; i < n; i++) printf("%d%c", ans[i], i == n - 1 ? '\n' : ' ');
  }
  return 0;
}
