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;
typedef long long ll;

class KMP {
public:
    string pattern;
    int plen;
    vector<int> table;

    // tからsを探す
    KMP(const string& s) : pattern(s), plen((int)pattern.size()), table(plen + 1) {
        table[0] = -1;
        int j = -1;
        for (int i = 0; i < plen; i++) {
            while (j >= 0 && pattern[i] != pattern[j]) j = table[j];
            if (pattern[i + 1] == pattern[++j]) table[i + 1] = table[j];
            else table[i + 1] = j;
        }
    }

    // マッチする左端の箇所
    vector<int> search(const string& text) {
        vector<int> res;
        int head = 0, j = 0, tlen = (int)text.size();
        while (head + j < tlen) {
            if (pattern[j] == text[head + j]) {
                if (++j != plen) continue;
                res.push_back(head);
            }
            head += j - table[j], j = max(table[j], 0);
        }
        return res;
    }
};

int main() {
    string t, p; cin >> t >> p;
    KMP kmp(p);
    for (int ans : kmp.search(t)) {
        cout << ans << endl;
    }
    return 0;
}
