#include <bits/stdc++.h>
using namespace std;
const int MaxN = 2e5 + 10;
int a[MaxN], b[MaxN], pos[MaxN];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    pos[a[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
  }
  int nxt = 0;
  for (int i = 1; i <= n; i++) {
    int p = pos[b[i]];
    if (nxt >= p)
      cout << 0;
    else {
      cout << p - nxt;
      nxt = p;
    }
    cout << (i == n ? '\n' : ' ');
  }
  return 0;
}
