#include<bits/stdc++.h>

using namespace std;

int main()
{
	string s,s1,s2;
	cin>>s1>>s2;
	s=s2+"_"+s1;
	static int next[1100000];
	memset(next,0,sizeof(next));
	next[0]=-1;
	for(int i=1;i<s.size();i++)
	{
		int j;
		for(j=next[i-1];s[j+1]!=s[i]&&j>=0;j=next[j]);
		next[i]=(s[j+1]==s[i]?j+1:-1);
	}
	for(int i=s2.size()+1;i<s.size();i++)
		if(next[i]+1==s2.size())
			printf("%d\n",i-s2.size()*2);
	return 0;
}
### 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;

int main()
{
	string s,s1,s2;
	cin>>s1>>s2;
	s=s2+"_"+s1;
	static int next[1100000];
	memset(next,0,sizeof(next));
	next[0]=-1;
	for(int i=1;i<s.size();i++)
	{
		int j;
		for(j=next[i-1];s[j+1]!=s[i]&&j>=0;j=next[j]);
		next[i]=(s[j+1]==s[i]?j+1:-1);
	}
	for(int i=s2.size()+1;i<s.size();i++)
		if(next[i]+1==s2.size())
			printf("%d\n",i-s2.size()*2);
	return 0;
}
```