#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 100;
const double pi = acos(-1.0);
struct cp {
  double x, y;
  cp(double xx = 0, double yy = 0) {
    x = xx;
    y = yy;
  }
  cp operator+(cp &a) { return cp(x + a.x, y + a.y); }
  cp operator-(cp &a) { return cp(x - a.x, y - a.y); }
  cp operator*(cp &a) { return cp(x * a.x - y * a.y, x * a.y + y * a.x); }
};
int fa[55], rev[maxn], lim, l, n, m;
char s[maxn], t[maxn];
void fft(cp *a, int k) {
  int i, j, o;
  for (i = 0; i < lim; i++)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (i = 1; i < lim; i <<= 1) {
    cp wn = cp(cos(pi / i), k * sin(pi / i));
    for (j = 0; j < lim; j += (i << 1)) {
      cp w = cp(1, 0);
      for (o = 0; o < i; o++, w = w * wn) {
        cp x = a[j + o], y = a[i + j + o] * w;
        a[j + o] = x + y;
        a[j + o + i] = x - y;
      }
    }
  }
  if (k == -1)
    for (i = 0; i < lim; i++) a[i].x = a[i].x / (double)(lim);
}
cp a[maxn], b[maxn], c[maxn];
int e[maxn][6][6];
int find(int x) {
  if (x == fa[x]) return x;
  int ff = fa[x];
  fa[x] = find(ff);
  return fa[x];
}
int main() {
  int i, p, q, k;
  scanf("%s", s);
  scanf("%s", t);
  n = strlen(s), m = strlen(t);
  lim = 1;
  while (lim <= n + m) lim <<= 1, l++;
  for (i = 0; i < lim; i++)
    rev[i] = ((rev[i >> 1] >> 1) | ((i & 1) << (l - 1)));
  for (p = 0; p < 6; p++)
    for (q = 0; q < 6; q++) {
      if (p == q) continue;
      for (i = 0; i < lim; i++) a[i] = b[i] = cp(0, 0);
      for (i = 0; i < m; i++) a[m - 1 - i].x = (t[i] == p + 'a');
      for (i = 0; i < n; i++) b[i].x = (s[i] == q + 'a');
      fft(a, 1);
      fft(b, 1);
      for (i = 0; i < lim; i++) c[i] = a[i] * b[i];
      fft(c, -1);
      for (i = m - 1; i < n; i++) e[i - m + 1][p][q] = (int)(c[i].x + 0.5);
    }
  for (k = 0; k <= n - m; k++) {
    for (i = 0; i < 6; i++) fa[i] = i;
    int ans = 0;
    for (p = 0; p < 6; p++)
      for (q = 0; q < 6; q++) {
        if (p == q) continue;
        if (!e[k][p][q]) continue;
        int x = find(p), y = find(q);
        if (x != y) fa[x] = y, ans++;
      }
    printf("%d ", ans);
  }
  return 0;
}
