Suppose you have two strings *s* and *t*, and their length is equal. You may perform the following operation any number of times: choose two different characters *c*<sub class="lower-index">1</sub> and *c*<sub class="lower-index">2</sub>, and replace every occurence of *c*<sub class="lower-index">1</sub> in both strings with *c*<sub class="lower-index">2</sub>. Let's denote the distance between strings *s* and *t* as the minimum number of operations required to make these strings equal. For example, if *s* is abcd and *t* is ddcb, the distance between them is 2 — we may replace every occurence of a with b, so *s* becomes bbcd, and then we may replace every occurence of b with d, so both strings become ddcd.

You are given two strings *S* and *T*. For every substring of *S* consisting of |*T*| characters you have to determine the distance between this substring and *T*.
The first line contains the string *S*, and the second — the string *T* (1 ≤ |*T*| ≤ |*S*| ≤ 125000). Both strings consist of lowercase Latin letters from a to f.
none
abcdefa
ddcb
2 3 3 3 

import sys
input = sys.stdin.buffer.readline 

def find_root(root_dict, x):
    L = []
    while x != root_dict[x]:
        L.append(x)
        x = root_dict[x]
    for y in L:
        root_dict[y] = x
    return x

def find_comp(pairs):
    root_dict = [i for i in range(6)]
    for i in range(36):
        if pairs[i] > 0:
            c1 = i//6
            c2 = i % 6
            if c1 != c2:
                i1 = find_root(root_dict, c1)
                i2 = find_root(root_dict, c2)
                root_dict[i1] = i2
    comp_count = 0
    for i in range(6):
        if find_root(root_dict, i)==i:
            comp_count+=1
    return comp_count
    
def process(S, T):
    n = len(S)
    m = len(T)
    S1 = [[] for i in range(6)]
    T1 = [[] for i in range(6)]
    for i in range(n):
        ci = ord(S[i])-ord('a')
        S1[ci].append(i)
    for i in range(m):
        ci = ord(T[i])-ord('a')
        T1[ci].append(i)
    pairs = [[0 for j in range(36)] for i in range(max(n, m))]
    for c1 in range(6):
        C1 = chr(c1+ord('a'))
        for c2 in range(6):
            c3 = 6*c1+c2
            k1 = [i for i in range(max(n, m))]
            for i in T1[c2]:
                k2 = []
                for k in k1:
                    if pairs[k][c3]==0 and i+k <= n-1 and S[i+k]==C1:
                        pairs[k][c3] = 1
                    elif i+k <= n-1:
                        k2.append(k)
                k1 = k2
    answer = [6-find_comp(pairs[i]) for i in range(n-m+1)]
    answer = ' '.join(map(str, answer))
    sys.stdout.write(f'{answer}\n')

S = input().decode().strip()
T = input().decode().strip()
process(S, T)
          