#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const int N = 125e3 + 5, S = 6;
bool B[S][S];
int A[6];
int find(int a) { return (!A[a] ? a : A[a] = find(A[a])); }
int n, m, ans;
char s1[N], s2[N];
int main() {
  scanf("%s %s", s1, s2);
  n = strlen(s1), m = strlen(s2);
  for (int i = m; i <= n; i++) {
    memset(A, 0, sizeof(A));
    memset(B, 0, sizeof(B));
    ans = 0;
    for (int k = i - m, j = 0; j < m; j++, k++) B[s1[k] - 'a'][s2[j] - 'a'] = 1;
    for (int j = 0; j < S; j++)
      for (int k = 0; k < S; k++) {
        if (!B[k][j]) continue;
        if (find(k) == find(j)) continue;
        ans++;
        A[find(j)] = find(k);
      }
    printf("%d ", ans);
  }
}
