#include <iostream>
#include <iterator>
#include <string>
#include <vector>
using namespace std;

vector <int> findGusfield (string s, string t) {
    vector <int> res;
    string r = s + "#" + t;
    int m = s.size (), len = r.size ();
    vector <int> z (len);
    z[0] = 0;
    int lo = 0, hi = 0;
    for (int i = 1; i < len; i++) {
        if (i < hi)
            z[i] = min (z[i - lo], hi - i);
        while (i + z[i] < len && r[z[i]] == r[i + z[i]])
            z[i] += 1;
        if (hi < i + z[i]) {
            lo = i;
            hi = i + z[i];
        }
        if (z[i] == m)
            res.push_back (i - m);
    }
    return res;
}

int main () {
    string s, t;
    cin >> s >> t;
    vector <int> res = findGusfield (s, t);
    if (res.empty ())
        cout << "none";
    else
        copy (res.begin (), res.end (),
            ostream_iterator <int> (cout, " "));
    return 0;
}
