#include <bits/stdc++.h>
using namespace std;
int a[200009], b[200009];
pair<int, int> p[200009];
int bs(int x, int n) {
  int l = 1, r = n, mid;
  while (l <= r) {
    mid = (l + r) / 2;
    if (p[mid].first < x) {
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  return p[l].second;
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
  }
  for (int i = 1; i <= n; i++) {
    p[i] = {a[i], i};
  }
  sort(p + 1, p + n + 1);
  int l = 1;
  for (int i = 1; i <= n; i++) {
    int pos = bs(b[i], n);
    if (pos > n || pos < l || a[pos] != b[i]) {
      cout << 0 << " ";
    } else {
      int r = pos - l + 1;
      cout << r << " ";
      l = pos + 1;
    }
  }
  return 0;
}
