#define _CRT_SECURE_NO_WARNINGS

#include<iostream>
#include<functional>
#include<algorithm>
#include<stack>
#include<queue>
#include<iomanip>
#include<set>
#include<map>
#include<utility>
#include<string>
#include<vector>

using namespace std;

#define LL long long
const int dx[4] = { 1,0,-1,0 };
const int dy[4] = { 0,1,0,-1 };
bool OOA(int x, int y, int H, int W) { return (0 <= x && x<H) && (0 <= y && y<W); }


const LL b1=1676943010,mod=2147483647;
string T,P;

void sarch(string str,string key){
	LL sh=0ll,kh=0ll,sl=str.size(),kl=key.size(),bpk=1ll;
	for(int i=0;i<kl;i++){
		sh=sh*b1+(LL)str[i];
		sh%=mod;
		kh=kh*b1+(LL)key[i];
		kh%=mod;
	}
	for(int i=0;i<P.size();i++){
		bpk*=b1;
		bpk%=mod;
	}
	for(int i=0;i+kl<=sl;i++){
		if(sh==kh)
			cout<<i<<endl;
		sh=sh*b1-bpk*(LL)str[i]+(LL)str[i+kl];
		sh%=mod;
	}
}

int main(){
	cin>>T>>P;
	if(T.size()<P.size())return 0;
	sarch(T,P);
	return 0;
}



### Prompt

Please provide a Cpp coded solution to the problem described below:

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
#define _CRT_SECURE_NO_WARNINGS

#include<iostream>
#include<functional>
#include<algorithm>
#include<stack>
#include<queue>
#include<iomanip>
#include<set>
#include<map>
#include<utility>
#include<string>
#include<vector>

using namespace std;

#define LL long long
const int dx[4] = { 1,0,-1,0 };
const int dy[4] = { 0,1,0,-1 };
bool OOA(int x, int y, int H, int W) { return (0 <= x && x<H) && (0 <= y && y<W); }


const LL b1=1676943010,mod=2147483647;
string T,P;

void sarch(string str,string key){
	LL sh=0ll,kh=0ll,sl=str.size(),kl=key.size(),bpk=1ll;
	for(int i=0;i<kl;i++){
		sh=sh*b1+(LL)str[i];
		sh%=mod;
		kh=kh*b1+(LL)key[i];
		kh%=mod;
	}
	for(int i=0;i<P.size();i++){
		bpk*=b1;
		bpk%=mod;
	}
	for(int i=0;i+kl<=sl;i++){
		if(sh==kh)
			cout<<i<<endl;
		sh=sh*b1-bpk*(LL)str[i]+(LL)str[i+kl];
		sh%=mod;
	}
}

int main(){
	cin>>T>>P;
	if(T.size()<P.size())return 0;
	sarch(T,P);
	return 0;
}



```