#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int A[n], B[n];
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  for (int i = 0; i < n; i++) {
    int x = A[i];
    B[x - 1] = i;
  }
  int C[n];
  for (int i = 0; i < n; i++) cin >> C[i];
  int max = -1;
  for (int i = 0; i < n; i++) {
    int j = C[i];
    int v = B[j - 1];
    if (v > max) {
      cout << v - max << " ";
      max = v;
    } else {
      cout << 0 << " ";
    }
  }
  cout << endl;
}
