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"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int KMPSearch(string& S,string& Q){
	vector<int> T(Q.size());
	T[0]=-1;
	if(T.size()>1) T[1]=0;
	for(int i=2,j=0,ei=Q.size();i<ei;){
		if(Q[i-1]==Q[j]){
			T[i] = ++j;
			i++;
		}
		else if(j>0){
			j = T[j];
		}
		else{
			T[i++] = 0;
		}
	}
	for(int m=0,i=0,es=S.size(),eq=Q.size();m+i<es;){
		if(Q[i]==S[m+i]){
			//if(i==e) return m;
			if(i+1==eq){
				out(m);
				m = m+i-T[i];
				if(i>0) i = T[i];
			}
			else i++;
		}
		else{
			m = m+i-T[i];
			if(i>0) i = T[i];
		}
	}
	return S.size();
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	string S=in<string>(),T=in<string>();
	KMPSearch(S,T);

	return 0;
}

