t=eval(input())

p=eval(input())

l_t=len(t)

l_p=len(p)

for i in range(l_t-l_p+1):

    if t[i:i+l_p]==p:

        print(i)

t=eval(input())

p=eval(input())

l_t=len(t)

l_p=len(p)

ans = []

for i in range(l_t-l_p+1):

    if t[i:i+l_p]==p:

        ans.append(i)

if ans:

    print(("\n".join(map(str, ans))))

t = eval(input())
p = eval(input())
l_t = len(t)
l_p = len(p)
for i in range(l_t - l_p + 1):
    if t[i : i + l_p] == p:
        print(i)

t = eval(input())
p = eval(input())
l_t = len(t)
l_p = len(p)
ans = []
for i in range(l_t - l_p + 1):
    if t[i : i + l_p] == p:
        ans.append(i)
if ans:
    print(("\n".join(map(str, ans))))

+ans = [] -        print(i) +        ans.append(i) +if ans: +    print(("\n".join(map(str, ans))))