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