#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
 

struct RollingHash{
	ll M;
	vector<ll> H,B;
	RollingHash(string s,ll b=1009LL,ll m=1000000007LL){
		M = m;
		ll n = s.size();
		B.resize(n+1);
		H.resize(n+1,0);
		B[0] = 1;
		for(ll i=0;i<n;i++){
			B[i+1] = (B[i]*b)%M;
			H[i+1] = (H[i]*b%M+s[i])%M;
		}
	}
	ll GetHash(ll l,ll r){ // [l,r)
		return (H[r]+(M-B[r-l]*H[l]%M))%M;
	}
};


 
int main(){
	string t,p;
	cin >> t >> p;
	RollingHash T(t);
	RollingHash P(p);

	ll lt = t.size();
	ll lp = p.size();
	FOR(i,0,lt-lp+1){
		if(T.GetHash(i,i+lp)==P.GetHash(0,lp)){
			cout << i << endl;
		}
	}
}

### Prompt

Your task is to create 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;
typedef long long ll;
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
 

struct RollingHash{
	ll M;
	vector<ll> H,B;
	RollingHash(string s,ll b=1009LL,ll m=1000000007LL){
		M = m;
		ll n = s.size();
		B.resize(n+1);
		H.resize(n+1,0);
		B[0] = 1;
		for(ll i=0;i<n;i++){
			B[i+1] = (B[i]*b)%M;
			H[i+1] = (H[i]*b%M+s[i])%M;
		}
	}
	ll GetHash(ll l,ll r){ // [l,r)
		return (H[r]+(M-B[r-l]*H[l]%M))%M;
	}
};


 
int main(){
	string t,p;
	cin >> t >> p;
	RollingHash T(t);
	RollingHash P(p);

	ll lt = t.size();
	ll lp = p.size();
	FOR(i,0,lt-lp+1){
		if(T.GetHash(i,i+lp)==P.GetHash(0,lp)){
			cout << i << endl;
		}
	}
}

```