#include <bits/stdc++.h>
using namespace std;
const int G = 3, P = (119 << 23) + 1;
char c[150005], s[150005];
int i, f[150005][10], n, m, lim, L, p[150005], j, ans;
int a[500005], b[500005], R[500005];
int qpow(int a, int b) {
  int ans = 1;
  for (; b; b >>= 1, a = 1ll * a * a % P)
    if (b & 1) ans = 1ll * ans * a % P;
  return ans;
}
void NTT(int* a, int f, int n) {
  for (int i = 0; i < n; i++)
    if (i < R[i]) swap(a[i], a[R[i]]);
  for (int i = 1; i < n; i <<= 1) {
    int gn = qpow(G, (P - 1) / (i << 1));
    for (int j = 0; j < n; j += (i << 1)) {
      int g = 1;
      for (int k = 0; k < i; k++, g = 1ll * g * gn % P) {
        int x = a[j + k], y = 1ll * g * a[j + k + i] % P;
        a[j + k] = (x + y) % P;
        a[j + k + i] = (x - y + P) % P;
      }
    }
  }
  if (f == 1) return;
  int nv = qpow(n, P - 2);
  reverse(a + 1, a + n);
  for (int i = 0; i < n; i++) a[i] = 1ll * a[i] * nv % P;
}
int Find(int x, int i) {
  if (f[x][i] == 0) return i;
  return f[x][i] = Find(x, f[x][i]);
}
void merge(int e, int u, int v) {
  int x = Find(e, u), y = Find(e, v);
  if (x != y) f[e][x] = y;
}
int main() {
  scanf("%s", c);
  n = strlen(c);
  scanf("%s", s);
  m = strlen(s);
  for (i = 0; i * 2 < m; ++i) swap(s[i], s[m - i - 1]);
  for (int ta = 0; ta < 6; ++ta)
    for (int tb = 0; tb < 6; ++tb)
      if (ta != tb) {
        memset(a, 0, sizeof(a));
        memset(b, 0, sizeof(b));
        memset(p, 0, sizeof(p));
        for (i = 0; i < n; ++i)
          if (c[i] == 'a' + ta)
            a[i] = 1;
          else
            a[i] = 0;
        for (i = 0; i < m; ++i)
          if (s[i] == 'a' + tb)
            b[i] = 1;
          else
            b[i] = 0;
        for (L = 0, lim = 1; lim <= n + m; lim <<= 1) ++L;
        for (int i = 0; i < lim; i++)
          R[i] = (R[i >> 1] >> 1) | ((i & 1) << (L - 1));
        NTT(a, 1, lim);
        NTT(b, 1, lim);
        for (i = 0; i < lim; ++i) a[i] = 1ll * a[i] * b[i] % P;
        NTT(a, -1, lim);
        for (i = m; i <= n; ++i)
          if (a[i - 1]) merge(i - m, ta + 1, tb + 1);
      }
  for (i = 0; i <= n - m; ++i) {
    ans = 0;
    for (j = 1; j <= 6; ++j)
      if (Find(i, j) == j) ++ans;
    printf("%d ", 6 - ans);
  }
}
