#include<cstdio>
#include<vector>
#include<algorithm>
#include<utility>
#include<numeric>
#include<iostream>
#include<array>
#include<string>
#include<sstream>
#include<stack>
#include<queue>
#include<list>
#include<functional>
#define _USE_MATH_DEFINES

#include<math.h>
#include<map>

#define SENTINEL 1000000001

#define min(a,b) (a)>(b)?(b):(a)
#define max(a,b) (a)>(b)?(a):(b)

using namespace std;

typedef pair<int, int> pii;

using namespace std;

void buildFail(const string& t, vector<int>& fail) {
	int m = t.size();
	fail.resize(m + 1);
	int j = -1;
	fail[0] = -1;
	for (int i = 1; i <= m; ++i) {
		while (j >= 0 && t[j] != t[i - 1]) j = fail[j];
		fail[i] = ++j;
	}
}

void match(const string& s, const string& t, vector<int>& res) {
	vector<int> fail;
	buildFail(t, fail);
	int n = s.size(), m = t.size();
	for (int i = 0, k = 0; i < n; ++i) {
		while (k >= 0 && t[k] != s[i]) k = fail[k];
		++k;
		if (k >= m) {
			res.emplace_back(i - m + 1);
			k = fail[k];
		}
	}
}
int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	string s, t;
	cin >> s >> t;
	vector<int> res;
	match(s, t, res);
	for (int x : res)
		cout << x << '\n';
	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<cstdio>
#include<vector>
#include<algorithm>
#include<utility>
#include<numeric>
#include<iostream>
#include<array>
#include<string>
#include<sstream>
#include<stack>
#include<queue>
#include<list>
#include<functional>
#define _USE_MATH_DEFINES

#include<math.h>
#include<map>

#define SENTINEL 1000000001

#define min(a,b) (a)>(b)?(b):(a)
#define max(a,b) (a)>(b)?(a):(b)

using namespace std;

typedef pair<int, int> pii;

using namespace std;

void buildFail(const string& t, vector<int>& fail) {
	int m = t.size();
	fail.resize(m + 1);
	int j = -1;
	fail[0] = -1;
	for (int i = 1; i <= m; ++i) {
		while (j >= 0 && t[j] != t[i - 1]) j = fail[j];
		fail[i] = ++j;
	}
}

void match(const string& s, const string& t, vector<int>& res) {
	vector<int> fail;
	buildFail(t, fail);
	int n = s.size(), m = t.size();
	for (int i = 0, k = 0; i < n; ++i) {
		while (k >= 0 && t[k] != s[i]) k = fail[k];
		++k;
		if (k >= m) {
			res.emplace_back(i - m + 1);
			k = fail[k];
		}
	}
}
int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	string s, t;
	cin >> s >> t;
	vector<int> res;
	match(s, t, res);
	for (int x : res)
		cout << x << '\n';
	return 0;
}

```