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

using namespace std;

vector<int> match_KMP(string & T, string & P);
vector<int> preprocess_KMP(string & P);

int main()
{
    ios::sync_with_stdio(false);
    string T;
    string P;
    cin >> T;
    cin >> P;
    auto result = match_KMP(T, P);
    for (auto pos : result) cout << pos << '\n';
    return 0;
}

vector<int> match_KMP(string & T, string & P){
    int n = T.size();
    int m = P.size();
    auto pi = preprocess_KMP(P);
    vector<int> result;
    int q = 0;
    for (int i = 0; i != n; ++i){
        while (q > 0 and T[i] != P[q]){
            q = pi[q];
        }
        if (T[i] == P[q]) ++q;
        if (q == m){
            result.push_back(i - m + 1);
            q = pi[q];
        }
    }
    return result;
}

vector<int> preprocess_KMP(string & P){
    int m = P.size();
    vector<int> pi(m + 1, 0);
    int k = 0;
    for (int q = 1; q != m; ++q){
        while (k > 0 and P[q] != P[k]){
            k = pi[k];
        }
        if (P[q] == P[k]) ++k;
        pi[q + 1] = k;
    }
    return pi;
}