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
#include <iostream>
#include <string>
#include <vector>

int main(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);

    std::string t;
    std::string p;
    std::cin >> t;
    std::cin >> p;
    int tl = t.length();
    int pl = p.length();
    //create table                                                                                                                                                                                                                     
    std::vector<int> table(pl + 1, 0);
    table[0] = -1;
    table[1] = 0;
    int i = 2; int j = 0;
    while(i <= pl){
        if(p[i-1] == p[j]){
            table[i] = j + 1;
            ++i;
            ++j;
        } else if(j > 0) j = table[j];
        else table[i++] = 0;
    }

    i = 0; j = 0;
    while(i < tl){
        if(t[i] == p[j]){
            ++i;
            ++j;
            if(j == pl){
                std::cout << i - pl << "\n";
                j = table[j];
            }
        } else if(j == 0){
            ++i;
        } else {
            j = table[j];
        }
    }
    return 0;
}
