#include <bits/stdc++.h>
using namespace std;
vector<int> arr;
const int MAX = 1e5 + 11;
int main() {
  int n;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  vector<int> query(n), ansQuery(n, -1);
  for (int i = 0; i < n; i++) scanf("%d", &query[i]);
  int idx = 0;
  for (int i = 0; i < n; i++) {
    int step = 0;
    if (ansQuery[query[i] - 1] == -1)
      for (int j = idx; j < n; j++) {
        step++, idx++;
        if (arr[j] == query[i]) {
          ansQuery[query[i] - 1] = step;
          break;
        } else {
          ansQuery[arr[j] - 1] = 0;
        }
      }
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", ansQuery[query[i] - 1]);
  }
  return 0;
}
