#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper")
#pragma GCC target("avx2")
using namespace std;
const int N1 = 20010, N2 = 40010, N3 = 80010, N4 = 125010, N5 = 60010;
bitset<N1> ss[6], tt[6];
bitset<N2> sss[6], ttt[6];
bitset<N3> ssss[6], tttt[6];
bitset<N4> sssss[6], ttttt[6];
bitset<N5> ssssss[6], tttttt[6];
char s[N4], t[N4];
bool re[6][6], b[6];
int dfs(int x) {
  if (b[x]) return 0;
  b[x] = 1;
  int ret = 1;
  for (int i = 0; i < 6; ++i)
    if (re[x][i] || re[i][x]) ret += dfs(i);
  return ret;
}
int main() {
  scanf("%s%s", s, t);
  int n = strlen(s), m = strlen(t);
  if (m <= 20000) {
    for (int i = 0; i < m; ++i) ss[s[i] - 'a'].set(i);
    for (int i = 0; i < m; ++i) tt[t[i] - 'a'].set(i);
    for (int u = 0; u <= n - m; ++u) {
      int ret = 0;
      for (int j = 0; j < 6; ++j) b[j] = 0;
      for (int i = 0; i < 6; ++i)
        for (int j = 0; j < 6; ++j) {
          re[i][j] = 0;
          if (j != i && (ss[i] & tt[j]).any()) re[i][j] = 1;
        }
      for (int i = 0; i < 6; ++i)
        if (!b[i]) ret += dfs(i) - 1;
      printf("%d ", ret);
      for (int i = 0; i < 6; ++i) ss[i] >>= 1;
      if (u < n - m) ss[s[u + m] - 'a'].set(m - 1);
    }
  } else if (m <= 40000) {
    for (int i = 0; i < m; ++i) sss[s[i] - 'a'].set(i);
    for (int i = 0; i < m; ++i) ttt[t[i] - 'a'].set(i);
    for (int u = 0; u <= n - m; ++u) {
      int ret = 0;
      for (int j = 0; j < 6; ++j) b[j] = 0;
      for (int i = 0; i < 6; ++i)
        for (int j = 0; j < 6; ++j) {
          re[i][j] = 0;
          if (j != i && (sss[i] & ttt[j]).any()) re[i][j] = 1;
        }
      for (int i = 0; i < 6; ++i)
        if (!b[i]) ret += dfs(i) - 1;
      printf("%d ", ret);
      for (int i = 0; i < 6; ++i) sss[i] >>= 1;
      if (u < n - m) sss[s[u + m] - 'a'].set(m - 1);
    }
  } else if (m <= 60010) {
    for (int i = 0; i < m; ++i) ssssss[s[i] - 'a'].set(i);
    for (int i = 0; i < m; ++i) tttttt[t[i] - 'a'].set(i);
    for (int u = 0; u <= n - m; ++u) {
      int ret = 0;
      for (int j = 0; j < 6; ++j) b[j] = 0;
      for (int i = 0; i < 6; ++i)
        for (int j = 0; j < 6; ++j) {
          re[i][j] = 0;
          if (j != i && (ssssss[i] & tttttt[j]).any()) re[i][j] = 1;
        }
      for (int i = 0; i < 6; ++i)
        if (!b[i]) ret += dfs(i) - 1;
      printf("%d ", ret);
      for (int i = 0; i < 6; ++i) ssssss[i] >>= 1;
      if (u < n - m) ssssss[s[u + m] - 'a'].set(m - 1);
    }
  } else if (m <= 80010) {
    for (int i = 0; i < m; ++i) ssss[s[i] - 'a'].set(i);
    for (int i = 0; i < m; ++i) tttt[t[i] - 'a'].set(i);
    for (int u = 0; u <= n - m; ++u) {
      int ret = 0;
      for (int j = 0; j < 6; ++j) b[j] = 0;
      for (int i = 0; i < 6; ++i)
        for (int j = 0; j < 6; ++j) {
          re[i][j] = 0;
          if (j != i && (ssss[i] & tttt[j]).any()) re[i][j] = 1;
        }
      for (int i = 0; i < 6; ++i)
        if (!b[i]) ret += dfs(i) - 1;
      printf("%d ", ret);
      for (int i = 0; i < 6; ++i) ssss[i] >>= 1;
      if (u < n - m) ssss[s[u + m] - 'a'].set(m - 1);
    }
  } else {
    for (int i = 0; i < m; ++i) sssss[s[i] - 'a'].set(i);
    for (int i = 0; i < m; ++i) ttttt[t[i] - 'a'].set(i);
    for (int u = 0; u <= n - m; ++u) {
      int ret = 0;
      for (int j = 0; j < 6; ++j) b[j] = 0;
      for (int i = 0; i < 6; ++i)
        for (int j = 0; j < 6; ++j) {
          re[i][j] = 0;
          if (j != i && (sssss[i] & ttttt[j]).any()) re[i][j] = 1;
        }
      for (int i = 0; i < 6; ++i)
        if (!b[i]) ret += dfs(i) - 1;
      printf("%d ", ret);
      for (int i = 0; i < 6; ++i) sssss[i] >>= 1;
      if (u < n - m) sssss[s[u + m] - 'a'].set(m - 1);
    }
  }
}
