// Copyright (C) 2017 __debug.

// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; version 3

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; If not, see <http://www.gnu.org/licenses/>.


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/priority_queue.hpp>

#define x first
#define y second
#define MP std::make_pair
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define DEBUG(...) fprintf(stderr, __VA_ARGS__)
#ifdef __linux__
#define getchar getchar_unlocked
#define putchar putchar_unlocked
#endif

using std::pair;
using std::vector;
using std::string;

typedef long long LL;
typedef pair<int, int> Pii;

const int oo = 0x3f3f3f3f;

template<typename T> inline bool chkmax(T &a, T b) { return a < b ? a = b, true : false; }
template<typename T> inline bool chkmin(T &a, T b) { return b < a ? a = b, true : false; }
string procStatus()
{
    std::ifstream t("/proc/self/status");
    return string(std::istreambuf_iterator<char>(t), std::istreambuf_iterator<char>());
}
template<typename T> T read(T &x)
{
    int f = 1;
    char ch = getchar();
    for (; !isdigit(ch); ch = getchar())
        f = (ch == '-' ? -1 : 1);
    for (x = 0; isdigit(ch); ch = getchar())
        x = 10 * x + ch - '0';
    return x *= f;
}
template<typename T> void write(T x)
{
    if (x == 0) {
        putchar('0');
        return;
    }
    if (x < 0) {
        putchar('-');
        x = -x;
    }
    static char s[20];
    int top = 0;
    for (; x; x /= 10)
        s[++top] = x % 10 + '0';
    while (top)
        putchar(s[top--]);
}
// EOT

const int MAXN = 2e5 + 5;
const int SIZE = 205;

int N;
LL L, R;
char S[MAXN];

void input()
{
    scanf("%s", S + 1);
    read(L); read(R);
    N = strlen(S + 1) / 2;
}

int M;
LL Flen[SIZE], cnt[SIZE];
int curc;

LL count(LL d, LL n)
{
    if (d <= 1) {
        LL ret = 0;
        for (int j = 1; j <= n; ++j) {
            ret += (S[j] == curc + 'a');
        }
        return ret;
    }
    if (n > Flen[d - 1])
        return cnt[d - 1] + count(d - 2, n - Flen[d - 1]);
    else
        return count(d - 1, n);
}

void solve()
{
    static int fail[MAXN];

    for (int i = 2; i <= N; ++i) {
        int p = fail[i - 1];
        while (p && S[p + 1] != S[i]) {
            p = fail[p];
        }
        fail[i] = p + (S[p + 1] == S[i]);
    }

    int period = N - fail[N];
    Flen[M++] = period;
    Flen[M++] = N;
    for (; Flen[M - 1] <= 2e18; ++M) {
        Flen[M] = Flen[M - 1] + Flen[M - 2];
    }

    for (curc = 0; curc < 26; ++curc) {
        std::fill(cnt, cnt + M, 0);
        for (int j = 1; j <= period; ++j) {
            cnt[0] += (S[j] == curc + 'a');
        }
        for (int j = 1; j <= N; ++j) {
            cnt[1] += (S[j] == curc + 'a');
        }
        for (int j = 2; j < M; ++j) {
            cnt[j] = cnt[j - 1] + cnt[j - 2];
        }

        printf("%lld ", count(M - 1, R) - count(M - 1, L - 1));
    }
}

int main()
{
#ifdef __DEBUG
    freopen("F.in", "r", stdin);
    freopen("F.out", "w", stdout);
#endif

    input();
    solve();
}

// 此生谁料，心在天山，身老沧洲。
//     -- 陆游《诉衷情·当年万里觅封侯》


Measured memory_bytes: 896