#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t, temp, index[200001], count = 0;
  cin >> t;
  vector<long long> steps, answer;
  for (long long i = 0; i < t; ++i) {
    long long Temp;
    cin >> Temp;
    index[Temp] = i + 1;
  }
  for (long long i = 0; i < t; ++i) {
    long long Temp;
    cin >> Temp;
    steps.push_back(Temp);
  }
  for (long long i = 0; i < t; ++i) {
    long long a = steps[i];
    answer.push_back(max(index[a] - count, 0));
    count += max(index[a] - count, 0);
  }
  for (vector<long long>::iterator i = answer.begin(); i != answer.end(); ++i)
    cout << *i << " ";
}
