T,P=input(),input()

for x in[i for i,c in enumerate(T)if P[0]==c]:P!=T[x:x+len(P)]or print(x)

def f():

 T,P=input(),input()

 for i in range(len(T)):P!=T[i:i+len(P)]or print(i)

f()

T, P = input(), input()
for x in [i for i, c in enumerate(T) if P[0] == c]:
    P != T[x : x + len(P)] or print(x)

def f():
    T, P = input(), input()
    for i in range(len(T)):
        P != T[i : i + len(P)] or print(i)


f()

-T, P = input(), input() -for x in [i for i, c in enumerate(T) if P[0] == c]: -    P != T[x : x + len(P)] or print(x) +def f(): +    T, P = input(), input() +    for i in range(len(T)): +        P != T[i : i + len(P)] or print(i) + + +f()