Find places where a string P is found within a text T. Print all indices of T where P found. The indices of T start with 0.

Constraints

* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P ≤ 10000
* The input consists of alphabetical characters and digits

Input

In the first line, a text T is given. In the second line, a string P is given.

Output

Print an index of T where P found in a line. Print the indices in ascending order.

Examples

Input

aabaaa
aa


Output

0
3
4


Input

xyzz
yz


Output

1


Input

abc
xyz


Output
def calc_hash(s, base, h):
    res = 0
    multi = 1
    for e in s:
        res = (res+ord(e)*multi) % h
        multi *= base
    return res


T = input()
P = input()

base = 100
h = 10**9+7
base_inv = pow(base, h-2, h)
base_m = pow(base, len(P), h)
hash = calc_hash(P, base, h)
curr_hash = calc_hash(T[0:len(P)], base, h)
ans = []
if(hash == curr_hash):
    ans.append(0)
for i in range(1, len(T)-len(P)+1):
    curr_hash = (
        (curr_hash-ord(T[i-1])+ord(T[i+len(P)-1])*base_m)*base_inv) % h
    if(curr_hash == hash):
        ans.append(i)
for e in ans:
    print(e)

