#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef unsigned long long ll;
typedef pair<int,int> pint;

const ll x=1000000007;
string t,p;
int main(){
    cin>>t>>p;
    ll st=t.size(),sp=p.size();
    if(st<sp) return 0;
    ll q=1;
    rep(i,sp) q=q*x;
    ll ht=0,hp=0;
    rep(i,sp){
        ht=(ht*x+t[i]);
        hp=(hp*x+p[i]);
    }
    rep(i,st-sp+1){
        if(ht==hp) cout<<i<<endl;
        if(i<st-sp)ht=ht*x+t[i+sp]-q*t[i];
    }
    return 0;
}

### Prompt

Please formulate a Cpp solution to the following problem:

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 FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef unsigned long long ll;
typedef pair<int,int> pint;

const ll x=1000000007;
string t,p;
int main(){
    cin>>t>>p;
    ll st=t.size(),sp=p.size();
    if(st<sp) return 0;
    ll q=1;
    rep(i,sp) q=q*x;
    ll ht=0,hp=0;
    rep(i,sp){
        ht=(ht*x+t[i]);
        hp=(hp*x+p[i]);
    }
    rep(i,st-sp+1){
        if(ht==hp) cout<<i<<endl;
        if(i<st-sp)ht=ht*x+t[i+sp]-q*t[i];
    }
    return 0;
}

```