#include <bits/stdc++.h>
using namespace std;
#pragma clang diagnostic push
#pragma ide diagnostic ignored "OCUnusedGlobalDeclarationInspection"
const char NL = '\n';
#pragma clang diagnostic pop
void run(istream &inp, ostream &outp);
int main() {
  ios_base::sync_with_stdio(false);
  istream &inp = cin;
  cin.tie(nullptr);
  ostream &outp = cout;
  outp << setprecision(8) << fixed;
  run(inp, outp);
  return 0;
}
const int SIZE = 200005;
uint_fast64_t a[SIZE];
void run(istream &inp, ostream &outp) {
  uint_fast64_t n;
  inp >> n;
  for (uint_fast64_t i = 0; i < n; ++i) {
    uint_fast64_t x;
    inp >> x;
    a[x - 1] = i + 1;
  }
  uint_fast64_t mx = 0;
  for (uint_fast64_t i = 0; i < n; ++i) {
    uint_fast64_t x;
    inp >> x;
    auto pos = a[x - 1];
    if (pos <= mx) {
      outp << "0 ";
    } else {
      outp << (pos - mx) << " ";
      mx = pos;
    }
  }
}
