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
# AOJ ALDS1_14_B "String Search"
# returns i s.t. S[i+j] = T[j] for 0 <= j < len(T)

def RollingHash(S, T):
    if len(S) < len(T):
        return []
    # gcd(h, b) = 1
    h = 10**11+7
    b = 10**7+7
    L = len(T)

    bL = 1
    for i in range(L):
        bL = bL * b % h

    hashS = 0
    for i in range(L):
        hashS = (hashS * b + ord(S[i])) % h

    hashT = 0
    for i in range(L):
        hashT = (hashT * b + ord(T[i])) % h
    
    correctIndexes = []
    if hashS == hashT:
        correctIndexes.append(0)
    for j in range(len(S)-L):
        hashS = (hashS * b - ord(S[j])*bL + ord(S[L+j])) % h
        if hashS == hashT:
            correctIndexes.append(j+1)
    return correctIndexes


if __name__ == "__main__":
    import sys
    input = sys.stdin.readline

    S = input().rstrip()
    T = input().rstrip()

    ans = RollingHash(S, T)
    for a in ans:
        print(a)
