#include <bits/stdc++.h>

#define show(x) cout << #x << " = " << x << endl

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "sz=" << v.size() << "\n[";
    for (const auto& p : v) {
        os << p << ",";
    }
    os << "]\n";
    return os;
}

template <typename S, typename T>
ostream& operator<<(ostream& os, const pair<S, T>& p)
{
    os << "(" << p.first << "," << p.second
       << ")";
    return os;
}


constexpr ll MOD = 1e9 + 7;

template <typename T>
constexpr T INF = numeric_limits<T>::max() / 100;
constexpr ll MAX = 100;

string S;
vector<ll> A;
void kmp()
{
    A[0] = -1;
    ll j = -1;
    for (ll i = 0; i < S.size(); i++) {
        while (j >= 0 && S[i] != S[j])
            j = A[j];
        j++;
        A[i + 1] = j;
    }
}


vector<ll> size;

ll rec(ll n, ll l, ll r, const vector<ll>& count0, const vector<ll>& count1, const vector<ll>& totals)
{
    // cout << "n: " << n << " l: " << l << " r: " << r << endl;
    if (l == 0 and r == size[n] - 1) {
        return totals[n];
    }
    if (n == 0) {
        if (l == 0) {
            return count0[r];
        } else {
            return count0[r] - count0[l - 1];
        }
    } else if (n == 1) {
        if (l == 0) {
            return count1[r];
        } else {
            return count1[r] - count1[l - 1];
        }
    } else {
        if (r < size[n - 1]) {
            return rec(n - 1, l, r, count0, count1, totals);
        } else if (l >= size[n - 1]) {
            return rec(n - 2, l - size[n - 1], r - size[n - 1], count0, count1, totals);
        } else {
            return rec(n - 1, l, size[n - 1] - 1, count0, count1, totals) + rec(n - 2, 0, r - size[n - 1], count0, count1, totals);
        }
    }
}

int main()
{
    string s;
    cin >> s;
    S = s.substr(0, s.size() / 2);
    ll l, r;
    cin >> l >> r;
    l--, r--;

    ll nums[26];
    fill(nums, nums + 26, 0);
    for (ll i = 0; i < s.size(); i++) {
        nums[s[i] - 'a']++;
    }
    ll kind = 0;
    ll cha = 0;
    for (ll i = 0; i < 26; i++) {
        if (nums[i] > 0) {
            kind++;
            cha = i;
        }
    }
    if (kind == 1) {  // S=aaa
        for (ll i = 0; i < 26; i++) {
            if (i == cha) {
                cout << r - l + 1 << " ";
            } else {
                cout << 0 << " ";
            }
        }
        cout << endl;
    } else {
        A.resize(S.size() + 1);
        kmp();
        const string S0 = S;
        const string S1 = S0 + S0.substr(0, S.size() - A[S.size()]);

        size.push_back(S0.size());
        size.push_back(S1.size());
        const ll size0 = S0.size();
        const ll size1 = S1.size();

        ll s0 = size0;
        ll s1 = size1;
        ll maxind = 2;
        while (true) {
            const ll s0_ = s0;
            s0 = s1;
            s1 = s0_ + s1;
            if (s1 > r) {
                break;
            }
            size.push_back(s1);
            maxind++;
        }
        //        show(maxind);
        for (ll alpha = 0; alpha < 26; alpha++) {
            const char c = 'a' + alpha;
            vector<ll> count0(size0, 0);
            vector<ll> count1(size1, 0);
            for (ll i = 0; i < size0; i++) {
                if (i == 0) {
                    count0[0] = ((c == S0[i]) ? 1 : 0);
                } else {
                    count0[i] = count0[i - 1] + ((c == S0[i]) ? 1 : 0);
                }
            }
            for (ll i = 0; i < size1; i++) {
                if (i == 0) {
                    count1[0] = ((c == S1[i]) ? 1 : 0);
                } else {
                    count1[i] = count1[i - 1] + ((c == S1[i]) ? 1 : 0);
                }
            }
            vector<ll> totals(maxind + 1);
            totals[0] = count0[size0 - 1];
            totals[1] = count1[size1 - 1];
            for (ll i = 2; i <= maxind; i++) {
                totals[i] = totals[i - 1] + totals[i - 2];
            }
            cout << rec(maxind, l, r, count0, count1, totals) << " ";
        }
        cout << endl;
    }

    return 0;
}


Measured memory_bytes: 4100