#include <bits/stdc++.h>
using namespace std;
stack<int> ent, aux;
int loop[200010];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    aux.push(a);
  }
  while (!aux.empty()) {
    ent.push(aux.top());
    aux.pop();
  }
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (loop[a]) {
      cout << "0 ";
      continue;
    }
    int cont = 0;
    while (!ent.empty() && ent.top() != a) {
      cont++;
      int s = ent.top();
      loop[s] = 1;
      ent.pop();
    }
    ent.pop();
    cout << cont + 1 << " ";
  }
  return 0;
}
