#include<bits/stdc++.h>
#include<string>

using namespace std;
#define fordebug int hoge;cin>>hoge;
#define DEKAI 1000000007
#define INF 200000000
#define int long long
#define lp(i,n) for(int i=0;i<n;i++)
#define lps(i,j,n) for(int i=j;i<n;i++)


vector<int> match(string a,string b){
	int al=a.size(),bl=b.size();
	vector<int> ans;
	if(al<bl) return ans;
	int t=1;
	int ah=0,bh=0;
	lp(i,bl){
		int x=a[i];
		int y=b[i];
		ah=ah*DEKAI+x;
		bh=bh*DEKAI+y;
		t*=DEKAI;
	}
	if(ah==bh) ans.push_back(0);
	for(int i=0;i+bl<al;i++){
		ah=ah*DEKAI+a[i+bl]-a[i]*t;
		if(ah==bh) ans.push_back(i+1);
	}
	return ans;
}

signed main(){
	string t,p;
	cin>>t>>p;
	vector<int> m=match(t,p);
	lp(i,m.size()) cout<<m[i]<<endl;
	return 0;
}

### Prompt

Generate 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>
#include<string>

using namespace std;
#define fordebug int hoge;cin>>hoge;
#define DEKAI 1000000007
#define INF 200000000
#define int long long
#define lp(i,n) for(int i=0;i<n;i++)
#define lps(i,j,n) for(int i=j;i<n;i++)


vector<int> match(string a,string b){
	int al=a.size(),bl=b.size();
	vector<int> ans;
	if(al<bl) return ans;
	int t=1;
	int ah=0,bh=0;
	lp(i,bl){
		int x=a[i];
		int y=b[i];
		ah=ah*DEKAI+x;
		bh=bh*DEKAI+y;
		t*=DEKAI;
	}
	if(ah==bh) ans.push_back(0);
	for(int i=0;i+bl<al;i++){
		ah=ah*DEKAI+a[i+bl]-a[i]*t;
		if(ah==bh) ans.push_back(i+1);
	}
	return ans;
}

signed main(){
	string t,p;
	cin>>t>>p;
	vector<int> m=match(t,p);
	lp(i,m.size()) cout<<m[i]<<endl;
	return 0;
}

```