#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
string trans(string s) {
    for (int i = s.size() - 1; i >= 0; i--) {
        if (s.substr(0, i) == s.substr(s.size() - i, i)) {
            string b = s.substr(0, s.size() - i);
            return s + b;
        }
    }
    assert(false);
    return "";
}
void stupid() {
    while (true) {
        string s;
        int p = rand() % 7 + 2;
        for (int i = 0; i < p; i++) {
            s += (char) (rand() % 2 + 'a');
        }
        string ns = trans(s);
        int blen = ns.size() - s.size();
        int slen = s.size() - blen;
//        if (blen <= slen) continue;
        bool f1 = (slen == 0);
        bool f2 = (s.size() % blen == 0);//(blen <= slen);
        if (blen <= slen && !f2) {
            s = ns;
            ns = trans(s);
            blen = ns.size() - s.size();
            slen = s.size() - blen;
            assert(blen > slen);
        }
        string init = s;
        s = ns;
        for (int step = 0; step < 10; step++) {
            string ns = trans(s);
            int hisb = ns.size() - s.size();
            int hiss = s.size() - hisb;
            if (f1) {
                assert(hisb == blen);
            }
            else if (f2) {
                assert(hisb == blen);
            }
            else {
//            if (hiss != blen) {
//                cout << init << " GG " << s << " " << ns << " " << hiss << " " << blen << endl;
//            }
                assert(hiss == blen);
            }
            blen = hisb;
            slen = hiss;
//            cout << s << " -> " << ns << endl;
            s = ns;
        }
    }
}
string s;
ll l, r;
vector < int > z_function(string& s) {
    vector < int > z(s.size());
    int l = 0;
    int r = 0;
    for (int i = 1; i < s.size(); i++) {
        if (r < i) {
            l = r = i;
        }
        z[i] = min(r - i, z[i - l]);
        while (i + z[i] < s.size() && s[z[i]] == s[i + z[i]]) z[i]++;
        if (i + z[i] > r) {
            l = i;
            r = i + z[i];
        }
    }
    return z;
}
ll ans[26];
ll len[100];
ll lenB[100];
ll lenS[100];
const ll INF = 1e18 + 2;
const int maxN = 2e5 + 10;
int pref[26][maxN];
ll calcB(ll r, int c, int who);
ll calcS(ll r, int c, int who);
ll calc(ll r, int c, int who);
map < pair < pair < ll, int >, int >, ll > mp, mpB, mpS;
ll calc(ll r, int c, int who) {
    if (who == 0) return pref[c][r];
    if (mp.find({{r, c}, who}) != mp.end()) return mp[{{r, c}, who}];
    ll& d = mp[{{r, c}, who}];
    if (r <= lenB[who] - 1) {
        return d = calc(r, c, who - 1);
    }
    return d = calc(lenB[who] - 1, c, who - 1) + calcB(r - lenB[who], c, who - 1);
}
ll calcB(ll r, int c, int who) {
    if (who == 0) return pref[c][r];
    if (mpB.find({{r, c}, who}) != mpB.end()) return mpB[{{r, c}, who}];
    ll& d = mpB[{{r, c}, who}];
    if (r <= lenB[who] - 1) {
        return d = calcB(r, c, who - 1);
    }
    return d = calcB(lenB[who] - 1, c, who - 1) + calcS(r - lenB[who], c, who - 1);
}
ll calcS(ll r, int c, int who) {
    if (who == 0) return pref[c][r];
    if (mpS.find({{r, c}, who}) != mpS.end()) return mpS[{{r, c}, who}];
    ll& d = mpS[{{r, c}, who}];
    return d = calcB(r, c, who - 1);
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
//    freopen("input.txt", "r", stdin);
    cin >> s;
    s = s.substr(0, s.size() / 2);
    cin >> l >> r;
    l--;
    r--;
    auto zz = z_function(s);
    int n = s.size();
    int blen = 0;
    int slen = 0;
    for (int i = 1; i < n; i++) {
        if (zz[i] == n - i) {
            blen = i;
            slen = n - i;
            break;
        }
    }
    if (blen == 0 && slen == 0) {
        blen = n;
    }
    if (n % blen == 0) {
        string f = s.substr(0, blen);
        for (int i = 0; i < f.size(); i++) {
            // blen * k + i >= l
            // blen * k + i <= r
            ll at_least = max(0LL, (l - i + blen - 1) / blen);
            ll at_most = (i > r ? -1 : (r - i) / blen);
            ans[f[i] - 'a'] += max(0LL, at_most - at_least + 1);
        }
        for (int i = 0; i < 26; i++) cout << ans[i] << " ";
    }
    else {
        for (int j = 0; j < 26; j++) {
            for (int i = 0; i < n; i++) {
                pref[j][i] = ((s[i] - 'a') == j);
                if (i) pref[j][i] += pref[j][i - 1];
            }
        }
        len[0] = s.size();
        lenB[0] = blen;
        lenS[0] = slen;
        int who = -1;
        for (int i = 1; i < 100; i++) {
            if (len[i - 1] - 1 >= r) {
                who = i - 1;
                break;
            }
            lenS[i] = lenB[i - 1];
            lenB[i] = len[i - 1];
            len[i] = lenB[i] + lenS[i];
        }
        assert(who != -1);
        for (int i = 0; i < 26; i++) {
            ans[i] = calc(r, i, who);
            if (l) ans[i] -= calc(l - 1, i, who);
            cout << ans[i] << " ";
        }
    }
    return 0;
}

Measured memory_bytes: 19792