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