#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int pos[N];
int main() {
  ios::sync_with_stdio(false);
  int n, a;
  while (cin >> n) {
    for (int i = 1; i <= n; ++i) {
      cin >> a;
      pos[a] = i;
    }
    int last = 0;
    for (int i = 1; i <= n; ++i) {
      cin >> a;
      cout << max(pos[a] - last, 0) << " ";
      last = max(last, pos[a]);
    }
    cout << endl;
  }
  return 0;
}
