#include <bits/stdc++.h>
using namespace std;
int placing[300000];
int order[300000];
int reverse_placing[300000];
int main() {
  int n;
  cin >> n;
  int placing_pointer = -1;
  for (int i = 1; i <= n; i++) {
    cin >> placing[i];
    reverse_placing[placing[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    cin >> order[i];
  }
  for (int i = 1; i <= n; i++) {
    if (placing_pointer == -1) {
      cout << reverse_placing[order[i]] << " ";
      placing_pointer = reverse_placing[order[i]];
    } else {
      if (reverse_placing[order[i]] < placing_pointer) {
        cout << 0 << " ";
      } else {
        cout << reverse_placing[order[i]] - placing_pointer << " ";
        placing_pointer = reverse_placing[order[i]];
      }
    }
  }
  return 0;
}
