#include <bits/stdc++.h>
using namespace std;
int z[200001], q[200001];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> q[i];
  }
  int l = 1, r = n, xx, num;
  for (int i = 1; i <= n; i++) {
    cin >> xx;
    num = 0;
    while (!z[xx]) {
      z[q[l]] = 1;
      l++;
      num++;
    }
    cout << num << " ";
  }
}
