#include <bits/stdc++.h>
using namespace std;
const int inf = 0x7fffffff;
const int NMAX = 2e5 + 1;
void solve() {
  int n;
  cin >> n;
  map<int, int> m;
  int a[NMAX], b[NMAX];
  for (int i = (0), _b_ = (n); i < _b_; i++) {
    cin >> a[i];
    m[a[i]] = i;
  }
  for (int i = (0), _b_ = (n); i < _b_; i++) {
    cin >> b[i];
  }
  int k = 0;
  for (int i = (0), _b_ = (n); i < _b_; i++) {
    int j = m[b[i]];
    if (j >= 0 && j < n) {
      cout << j - k + 1 << " ";
      for (int t = (k), _b_ = (j + 1); t < _b_; t++) {
        m[a[t]] = -1;
      }
      k = j + 1;
    } else {
      cout << "0 ";
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
