#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstring>
using namespace std;

const long long B=1000000000000000009LL;
const long long P=1000000000000000031LL;

vector<long long> gen_hash(const string &s){
	vector<long long> hash(s.size());
	long long c=0;
	for(int i=0;i<s.size();i++){
		c=(c*(__int128_t)B+s[i])%P;
		hash[i]=c;
	}
	return hash;
}
long long pow_binary_mod(long long x,long long y,long long mod){
	long long z=1;
	for(;y;y>>=1){
		if((y&1)!=0)z=(__int128_t)z*x%mod;
		x=(__int128_t)x*x%mod;
	}
	return z;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	string s;
	cin>>s;
	vector<long long> v=gen_hash(s);

	//int T;
	//for(cin>>T;T--;){
		string q;
		cin>>q;
		long long hash=gen_hash(q)[q.size()-1];
		long long Brev=pow_binary_mod(B,q.size(),P);
		vector<long long> r;
		int i=q.size()-1;
		for(;i<s.size();i++){
			if(v[i]==((i==q.size()-1?0:v[i-q.size()])*(__int128_t)Brev+hash)%P){
				r.push_back(i-q.size()+1);
			}
		}
		if(!r.empty()){
			for(int i=0;i<r.size();i++)printf("%d\n",r[i]);
			//puts("1");
		}else{
			//puts("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 <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstring>
using namespace std;

const long long B=1000000000000000009LL;
const long long P=1000000000000000031LL;

vector<long long> gen_hash(const string &s){
	vector<long long> hash(s.size());
	long long c=0;
	for(int i=0;i<s.size();i++){
		c=(c*(__int128_t)B+s[i])%P;
		hash[i]=c;
	}
	return hash;
}
long long pow_binary_mod(long long x,long long y,long long mod){
	long long z=1;
	for(;y;y>>=1){
		if((y&1)!=0)z=(__int128_t)z*x%mod;
		x=(__int128_t)x*x%mod;
	}
	return z;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	string s;
	cin>>s;
	vector<long long> v=gen_hash(s);

	//int T;
	//for(cin>>T;T--;){
		string q;
		cin>>q;
		long long hash=gen_hash(q)[q.size()-1];
		long long Brev=pow_binary_mod(B,q.size(),P);
		vector<long long> r;
		int i=q.size()-1;
		for(;i<s.size();i++){
			if(v[i]==((i==q.size()-1?0:v[i-q.size()])*(__int128_t)Brev+hash)%P){
				r.push_back(i-q.size()+1);
			}
		}
		if(!r.empty()){
			for(int i=0;i<r.size();i++)printf("%d\n",r[i]);
			//puts("1");
		}else{
			//puts("0");
		}
	//}
}
```