#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]] = i;
  }
  vector<int> b(n);
  for (int j = 0; j < n; j++) {
    cin >> b[j];
  }
  stack<int> pilha;
  for (int k = n - 1; k > -1; k--) {
    pilha.push(a[k]);
  }
  for (int g = 0; g < n; g++) {
    int c = 0;
    while (!pilha.empty()) {
      if (m[b[g]] < m[pilha.top()]) {
        break;
      }
      pilha.pop();
      c++;
    }
    cout << c << " ";
  }
  cout << endl;
  return 0;
}
