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

int const p = 821, q = 999999937;

vector <int> findRabinKarp (string s, string t) {
    vector <int> res;
    int m = s.size (), n = t.size ();
    int hs = 0, ht = 0, pm = 1;
    for (int j = 0; j < m; j++) {
        hs = (hs * 1LL * p + s[j]) % q;
        pm = (pm * 1LL * p) % q;
    }
    for (int i = 0; i < n; i++) {
        ht = (ht * 1LL * p + t[i]) % q;
        if (i >= m) {
            ht = (ht - t[i - m] * 1LL * pm) % q;
            if (ht < 0) ht += q;
        }
        if (ht == hs)
            res.push_back (i - m + 2);
    }
    return res;
}

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