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;

vector<int> kmp(const string &s, const string &t) {
  vector<int> ta(t.size() + 1);
  {
    ta[0] = -1;
    int j = -1;
    for (int i = 0; i < t.size(); i++) {
      while (j >= 0 && t[i] != t[j]) j = ta[j];
      ta[i + 1] = ++j;
    }
  }
  vector<int> ret;
  int m = 0, i = 0, n = s.size();
  while (m + i < n) {
    if (t[i] == s[m + i]) {
      if (++i == (int) t.size()) {
        ret.push_back(m);
        m = m + i - ta[i];
        i = ta[i];
      }
    } else {
      m = m + i - ta[i];
      if (i > 0) i = ta[i];
    }
  }
  return ret;
}

int main() {
  string t, p;
  cin >> t >> p;
  auto r = kmp(t, p);
  for (int i = 0; i < r.size(); i++) {
    cout << r[i] << endl;
  }
  return 0;
}

