#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> a;
  vector<int> b(n);
  int num;
  for (int i = 1; i <= n; i++) {
    cin >> num;
    a[num] = i;
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  int cur = 0;
  for (int i = 0; i < n; i++) {
    if (a[b[i]] > cur) {
      cout << a[b[i]] - cur << " ";
      cur = a[b[i]];
    } else {
      cout << 0 << " ";
    }
  }
  cout << endl;
  return 0;
}
