#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int v[n];
  int index = -1;
  for (int i = 0; i < n; i++) {
    int num;
    cin >> num;
    v[num] = i;
  }
  for (int j = 0; j < n; j++) {
    int num;
    cin >> num;
    if (v[num] > index) {
      if (index != -1)
        cout << v[num] - index << " ";
      else
        cout << v[num] + 1 << " ";
      index = v[num];
    } else
      cout << "0"
           << " ";
  }
}
