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
#include <bits/stdc++.h>
using namespace std;
#define MAX_P 10005
#define MAX_T 1000005

char T[MAX_T], P[MAX_P];
int nx[MAX_P];

int main(void) {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int i, j;

	cin.getline(T, MAX_T);
	int T_len = cin.gcount() - 1;
	cin.getline(P, MAX_P);
	int P_len = cin.gcount() - 1;

	nx[0] = -1;
	nx[1] = 0;
	for (i = 1; i < P_len; i++) {
		int k = i;
		while (nx[k] != -1) {
			if (P[nx[k]] == P[i]) {
				break;
			}
			k = nx[k];
		}
		nx[i + 1] = nx[k] + 1;
	}
	i = 0;
	j = 0;
	while (i < T_len) {
		if (T[i] == P[j]) {
			i++;
			j++;
			if (j == P_len) {
				cout << i - j << endl;
				j = nx[j]; // j在++之后不会为0
			}
		} else {
			j = nx[j];
			if (j == -1) {
				i++;
				j++;
			}
		}
	}
}
