#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <list>

using namespace std;

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

typedef pair<long long int, long long int> P;

int main(){
	
	string T, P;
	cin >> T >> P;
	
	if(T.size() < P.size()){
		return 0;
	}
	
	unsigned long long int P_val = 0, T_val = 0, MOD_P = 1;
	
	for(int i = 0; i < P.size(); i++){
		P_val *= MOD;
		P_val += P[i];
		MOD_P *= MOD;
	}
	
	for(int i = 0; i < P.size(); i++){
		T_val *= MOD;
		T_val += T[i];
	}
	
	if(T_val == P_val){
		cout << 0 << endl;
	}
	
	for(int i = P.size(); i < T.size(); i++){
		T_val *= MOD;
		T_val += T[i];
		T_val -= MOD_P * T[i - P.size()];
		if(T_val == P_val){
			cout << i - P.size() + 1 << endl;
		}
	}
	
	return 0;
}


### Prompt

Create a solution in CPP for 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
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <list>

using namespace std;

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

typedef pair<long long int, long long int> P;

int main(){
	
	string T, P;
	cin >> T >> P;
	
	if(T.size() < P.size()){
		return 0;
	}
	
	unsigned long long int P_val = 0, T_val = 0, MOD_P = 1;
	
	for(int i = 0; i < P.size(); i++){
		P_val *= MOD;
		P_val += P[i];
		MOD_P *= MOD;
	}
	
	for(int i = 0; i < P.size(); i++){
		T_val *= MOD;
		T_val += T[i];
	}
	
	if(T_val == P_val){
		cout << 0 << endl;
	}
	
	for(int i = P.size(); i < T.size(); i++){
		T_val *= MOD;
		T_val += T[i];
		T_val -= MOD_P * T[i - P.size()];
		if(T_val == P_val){
			cout << i - P.size() + 1 << endl;
		}
	}
	
	return 0;
}


```