#include<bits/stdc++.h>
using namespace std;
#define int long long

const int B = 1e9+7, H = 1e9+9;
//Hash(C) = (C1*B^(n-1)+...+Cn*B^0) mod H
//aはbに含まれているか
int contain(string a,string b){
  if(a.size() > b.size()) return false;

  int t = 1,ah = 0,bh = 0;
  for(int i = 0; i < a.size(); i++) ah = ah*B + a[i],t *= B;
  for(int i = 0; i < a.size(); i++) bh = bh*B + b[i];

  int cnt = 0;
  for(int i = a.size(); i <= b.size(); i++){
    if(ah == bh) cnt++,cout << i-a.size() << endl;
    if(i >= b.size()) break;
    bh = bh*B + b[i] - b[i-a.size()]*t;
  }
  return cnt;
}

signed main(){

  string s,t; cin >> s >> t;
  contain(t,s);

  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<bits/stdc++.h>
using namespace std;
#define int long long

const int B = 1e9+7, H = 1e9+9;
//Hash(C) = (C1*B^(n-1)+...+Cn*B^0) mod H
//aはbに含まれているか
int contain(string a,string b){
  if(a.size() > b.size()) return false;

  int t = 1,ah = 0,bh = 0;
  for(int i = 0; i < a.size(); i++) ah = ah*B + a[i],t *= B;
  for(int i = 0; i < a.size(); i++) bh = bh*B + b[i];

  int cnt = 0;
  for(int i = a.size(); i <= b.size(); i++){
    if(ah == bh) cnt++,cout << i-a.size() << endl;
    if(i >= b.size()) break;
    bh = bh*B + b[i] - b[i-a.size()]*t;
  }
  return cnt;
}

signed main(){

  string s,t; cin >> s >> t;
  contain(t,s);

  return 0;
}


```