#include <bits/stdc++.h>
using namespace std;
int main() {
  int ar[200005], i, n, b, j, k;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> b;
    ar[b] = i;
  }
  j = 0;
  for (i = 1; i <= n; i++) {
    cin >> b;
    if (j < ar[b]) {
      cout << ar[b] - j << " ";
      j = ar[b];
    } else
      cout << "0 ";
    if (j == n) {
      for (k = i + 1; k <= n; k++) {
        cout << "0 ";
      }
      cout << endl;
      return 0;
    }
  }
  cout << endl;
  return 0;
}
