#include <bits/stdc++.h>
using namespace std;
int x[200005], a[200005], inx[200005];
vector<int> v;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    inx[a[i]] = i + 1;
  }
  for (int i = 0; i < n; i++) cin >> x[i];
  int idx = 0;
  for (int i = 0; i < n; i++) {
    if (inx[x[i]] < idx)
      v.push_back(0);
    else {
      v.push_back(inx[x[i]] - idx);
      idx = inx[x[i]];
    }
  }
  for (auto i : v) cout << i << " ";
  return 0;
}
