#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int q[n + 1];
  long long int b[n + 1];
  for (long long int p = 1; p <= n; p++) {
    b[p] = 0;
  }
  queue<long long int> a;
  for (long long int i = 1; i <= n; i++) {
    long long int x;
    cin >> x;
    a.push(x);
  }
  for (long long int j = 1; j <= n; j++) {
    cin >> q[j];
  }
  for (long long int j = 1; j <= n; j++) {
    long long int temp = q[j];
    if (b[temp] == 1) {
      cout << 0 << " ";
    } else {
      long long int count = 0;
      while (!a.empty()) {
        long long int y = a.front();
        a.pop();
        count++;
        if (y == temp) {
          b[y] = 1;
          cout << count << " ";
          break;
        }
        b[y] = 1;
      }
    }
  }
  return 0;
}
