#include <vector>
#include <string>
#include <cstdint>
#include <bits/stdc++.h>

using namespace std; //ごめんなさい

vector<int> RH(string S,string T){
  int SN=S.size();
  int TN=T.size();
  int_fast64_t b=9973; 
  vector<int_fast64_t>mod={1000000007LL,1000000009LL,1000000021LL}; 
  int M=mod.size();
  vector<int_fast64_t>s(M,0);
  vector<int_fast64_t>t(M,0);
  vector<int_fast64_t>a(M,1);
  for(int i=0;i<TN;i++){
    for(int j=0;j<M;j++){
      a[j]=(a[j]*b)%mod[j];
    }
  }
  for(int i=0;i<TN;i++){
    for(int j=0;j<M;j++){
      s[j]=((s[j]*b)%mod[j]+S[i])%mod[j];
    }
  }
  for(int i=0;i<TN;i++){
    for(int j=0;j<M;j++){
      t[j]=((t[j]*b)%mod[j]+T[i])%mod[j];
    }
  }
  vector<int>res;
  bool ok=true;
  for(int i=0;i<M;i++)if(s[i]!=t[i])ok=false;
  if(ok)res.push_back(0);
  for(int i=0;i+TN<SN;i++){
    ok=true;
    for(int j=0;j<M;j++){
      s[j]=((s[j]*b)%mod[j]-(S[i]*a[j])%mod[j])%mod[j];
      if(s[j]<0)s[j]+=mod[j];
      s[j]=(s[j]+S[i+TN])%mod[j];
      if(s[j]!=t[j])ok=false;
    }
    if(ok)res.push_back(i+1);
  }
  return res;
}


int main(){
  string S,T;
  cin>>S>>T;
  auto v=RH(S,T);
  for(auto it:v)cout<<it<<endl;
  return 0;
}


### Prompt

Develop a solution in cpp to the problem described below:

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 <vector>
#include <string>
#include <cstdint>
#include <bits/stdc++.h>

using namespace std; //ごめんなさい

vector<int> RH(string S,string T){
  int SN=S.size();
  int TN=T.size();
  int_fast64_t b=9973; 
  vector<int_fast64_t>mod={1000000007LL,1000000009LL,1000000021LL}; 
  int M=mod.size();
  vector<int_fast64_t>s(M,0);
  vector<int_fast64_t>t(M,0);
  vector<int_fast64_t>a(M,1);
  for(int i=0;i<TN;i++){
    for(int j=0;j<M;j++){
      a[j]=(a[j]*b)%mod[j];
    }
  }
  for(int i=0;i<TN;i++){
    for(int j=0;j<M;j++){
      s[j]=((s[j]*b)%mod[j]+S[i])%mod[j];
    }
  }
  for(int i=0;i<TN;i++){
    for(int j=0;j<M;j++){
      t[j]=((t[j]*b)%mod[j]+T[i])%mod[j];
    }
  }
  vector<int>res;
  bool ok=true;
  for(int i=0;i<M;i++)if(s[i]!=t[i])ok=false;
  if(ok)res.push_back(0);
  for(int i=0;i+TN<SN;i++){
    ok=true;
    for(int j=0;j<M;j++){
      s[j]=((s[j]*b)%mod[j]-(S[i]*a[j])%mod[j])%mod[j];
      if(s[j]<0)s[j]+=mod[j];
      s[j]=(s[j]+S[i+TN])%mod[j];
      if(s[j]!=t[j])ok=false;
    }
    if(ok)res.push_back(i+1);
  }
  return res;
}


int main(){
  string S,T;
  cin>>S>>T;
  auto v=RH(S,T);
  for(auto it:v)cout<<it<<endl;
  return 0;
}


```