#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[200005];
long long b[200005];
bool done[200005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> b[i];
  long long cur = 1;
  for (int i = 1; i <= n; i++) {
    if (done[b[i]]) {
      cout << 0 << " ";
      continue;
    } else {
      long long cnt = 0;
      while (cur <= n && a[cur] != b[i]) {
        done[a[cur]] = 1;
        cur++, cnt++;
      }
      cnt++;
      cur++;
      cout << cnt << " ";
    }
  }
  cout << endl;
  return 0;
}
