#include <bits/stdc++.h>
using namespace std;
string s;
int first, n;
int a[222222];
int b[222222];
bool v[222222];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
  }
  for (int i = 0; i < n; ++i) {
    int next = b[i];
    if (v[next]) {
      cout << 0 << " ";
      continue;
    }
    int prev = first;
    while (a[first] != next) {
      v[a[first]] = true;
      first++;
    }
    cout << first - prev + 1 << " ";
    v[a[first]] = true;
    first++;
  }
  return 0;
}
