#include <bits/stdc++.h>
using namespace std;
long long ind[200001], arr[200001];
int main() {
  ios::sync_with_stdio(false);
  long long i, j, k, n, l = 1, a;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    ind[arr[i]] = i + 1;
  }
  for (i = 0; i < n; i++) {
    cin >> a;
    if (ind[a] >= l) {
      cout << ind[a] - l + 1 << " ";
      l = ind[a] + 1;
    } else
      cout << 0 << " ";
  }
}
