#include <bits/stdc++.h>
using namespace std;
using std::string;
int a[2 * 100002], b[2 * 100002], mark[2 * 100002];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int(i) = 0; (i) < (n); ++(i)) cin >> b[i];
  int l = 0;
  for (int(i) = 0; (i) < (n); ++(i)) {
    if (mark[b[i]] == 1) {
      cout << 0 << " ";
      continue;
    }
    int cnt = 0;
    while (l < n) {
      mark[a[l]] = 1;
      cnt++;
      if (a[l] == b[i]) {
        l++;
        cout << cnt << " ";
        break;
      }
      l++;
    }
  }
}
