#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int i;
  unordered_map<int, int> M;
  for (i = 0; i < n; i++) {
    int x;
    cin >> x;
    M[x] = i;
  }
  int z = -1;
  for (i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (M.find(x) == M.end()) {
      cout << 0 << " ";
    } else {
      if (M[x] > z) {
        cout << M[x] - z << " ";
        z = M[x];
      } else {
        cout << 0 << " ";
      }
    }
  }
  return 0;
}
