#include <bits/stdc++.h>
#pragma GCC optimize("03")
using namespace std;
int const mod = 1000000007;
set<int> ss;
vector<int> v1;
int id, ar[200100];
int solve(int val) {
  if (!ss.count(val)) return 0;
  int cnt = 0;
  for (int i = id; i < v1.size(); i++) {
    ss.erase(ss.find(v1[i]));
    id += 1;
    cnt += 1;
    if (v1[i] == val) break;
  }
  return cnt;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, x, cnt;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    v1.push_back(x);
    ss.insert(x);
  }
  id = 0;
  for (int i = 1; i <= n; i++) {
    cin >> ar[i];
  }
  for (int i = 1; i <= n; i++) {
    cnt = solve(ar[i]);
    cout << cnt << " ";
  }
  return 0;
}
