#include <bits/stdc++.h>
using namespace std;
int n, kt[200001];
queue<int> q;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    q.push(a);
  }
  for (int i = 1; i <= n; i++) {
    int b, d = 0;
    cin >> b;
    if (kt[b] == 0)
      while (!q.empty()) {
        int u = q.front();
        q.pop();
        kt[u] = 1;
        d++;
        if (u == b) break;
      }
    cout << d << " ";
  }
  return 0;
}
