#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int pos[n + 1];
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    pos[x] = i;
  }
  int curIndex = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (pos[x] < curIndex) {
      cout << "0 ";
    } else {
      cout << pos[x] - curIndex + 1 << " ";
      curIndex = pos[x] + 1;
    }
  }
}
