#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ull unsigned long long
#define INF 9223372036854775807
#define M 100000003

signed main()
{
    string s, p;
    cin >> s >> p;

    ull q[s.size() + 1];
    ull h[s.size() + 1];
    q[0] = 1;
    h[0] = 0;
    for (int i = 1; i <= s.size(); i++)
    {
        q[i] = q[i - 1] * M;
        h[i] = h[i - 1] * M + s[i - 1];
    }

    ull ht = 0;

    for (int i = 0; i < p.size(); i++)
        ht = ht * M + p[i];

    for (int i = p.size(); i <= s.size(); i++)
    {
        ull hs = h[i] - h[i - p.size()] * q[p.size()];
        if (hs == ht)
            cout << i - p.size() << endl;
    }
}

### Prompt

Construct a CPP code solution to the problem outlined:

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

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ull unsigned long long
#define INF 9223372036854775807
#define M 100000003

signed main()
{
    string s, p;
    cin >> s >> p;

    ull q[s.size() + 1];
    ull h[s.size() + 1];
    q[0] = 1;
    h[0] = 0;
    for (int i = 1; i <= s.size(); i++)
    {
        q[i] = q[i - 1] * M;
        h[i] = h[i - 1] * M + s[i - 1];
    }

    ull ht = 0;

    for (int i = 0; i < p.size(); i++)
        ht = ht * M + p[i];

    for (int i = p.size(); i <= s.size(); i++)
    {
        ull hs = h[i] - h[i - p.size()] * q[p.size()];
        if (hs == ht)
            cout << i - p.size() << endl;
    }
}

```