#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
ull B=950527;
int n,m;
char str[1000005];
ull a[1000005];

int main(){
  scanf("%s",str);
  n=strlen(str);
  for(int i=0;i<n;i++){
    a[i]=str[i];
    if(i)a[i]+=a[i-1]*B;
  }
  scanf("%s",str);
  m=strlen(str);
  ull key=0,num=0,C=1;
  for(int i=0;i<m;i++){
    key=key*B+str[i];
    C*=B;
  }
  for(int i=0;i<n;i++){
    num=a[i];
    if(i-m>=0)num-=C*a[i-m];
    if(key==num){
      printf("%d\n",i-m+1);
    }
  }
   
  return 0;
}
### Prompt

Please create a solution in CPP 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<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
ull B=950527;
int n,m;
char str[1000005];
ull a[1000005];

int main(){
  scanf("%s",str);
  n=strlen(str);
  for(int i=0;i<n;i++){
    a[i]=str[i];
    if(i)a[i]+=a[i-1]*B;
  }
  scanf("%s",str);
  m=strlen(str);
  ull key=0,num=0,C=1;
  for(int i=0;i<m;i++){
    key=key*B+str[i];
    C*=B;
  }
  for(int i=0;i<n;i++){
    num=a[i];
    if(i-m>=0)num-=C*a[i-m];
    if(key==num){
      printf("%d\n",i-m+1);
    }
  }
   
  return 0;
}
```