#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n], b[n];
  map<int, int> m;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    m[a[i]] = i;
  }
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
  }
  int prev = 0;
  map<int, int>::iterator itr;
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (m.find(b[i])->second < prev) {
      cout << "0 ";
    } else {
      cout << abs(prev - m[b[i]]) + 1 << " ";
      if (prev <= m[b[i]]) prev = m[b[i]] + 1;
    }
  }
}
