#include <bits/stdc++.h>
using namespace std;
long long n, b[200005], sum, a[200005];
set<long long> s;
stack<long long> st;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s.insert(a[i]);
  }
  for (int i = n; i >= 0; i--) {
    st.push(a[i]);
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < n; i++) {
    sum = 0;
    if (*s.find(b[i]) == b[i]) {
      if (!st.empty()) {
        while (st.top() != b[i]) {
          s.erase(st.top());
          st.pop();
          sum++;
        }
      }
      if (i == 0) {
        cout << sum + 1 << " ";
      } else {
        cout << sum << " ";
      }
    } else {
      cout << "0"
           << " ";
    }
  }
  return 0;
}
