#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> a(n), b(n), c(n);
  for (int i = 0; i < n; ++i) {
    long long num;
    cin >> num;
    num--;
    a[num] = i;
  }
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
    b[i]--;
  }
  for (int i = 0; i < n; ++i) {
    c[i] = a[b[i]];
  }
  long long mx = c[0];
  cout << c[0] + 1 << ' ';
  for (int i = 1; i < n; ++i) {
    if (mx >= c[i])
      cout << 0 << ' ';
    else {
      cout << c[i] - mx << ' ';
      mx = c[i];
    }
  }
  return 0;
}
