#include <bits/stdc++.h>

#define mp make_pair
#define pb push_back


typedef long long ll;
typedef long long llong;
typedef long double ld;

using namespace std;

template <typename T> void dprint(T begin, T end) {
    for (auto i = begin; i != end; i++) {
        cerr << (*i) << " ";
    }
    cerr << "\n";
}
const int MAXN = 1000000;
int z[MAXN];
char s[MAXN];
ll cc[100];

void zz(int n) {
    z[0] = 0;
    int l = 0;
    int r = 0;
    for (int i = 1; i < n; ++i) {
        if (r > i)
            z[i] = min(r - i, z[i - l]);
        else
            z[i] = 0;
        while (i + z[i] < n && s[i + z[i]] == s[z[i]])
            ++z[i];
        if (i + z[i] > r)
            r = i + z[i], l = i;
    }
}

struct st {
    ll len;
    int l, r;
    int dp;
    ll cc[26];
    st(int l, int r): l(l), r(r) {
        len = r - l;
        dp = 0;
        for (int i = 0; i < 26; ++i)
            cc[i] = 0;
        for (int i = l; i < r; ++i)
            ++cc[s[i] - 'a'];
    }
    st operator+(st x) {
        st ans(0, 0);
        ans.len = len + x.len;
        ans.l = x.l;
        ans.r = x.r;
        ans.dp = x.dp + 1;
        for (int i = 0; i < 26; ++i)
            ans.cc[i] = cc[i] + x.cc[i];
        return ans;
    }
    st operator-(st x) {
        st ans(0, 0);
        ans.len = len - x.len;
        ans.l = l;
        ans.r = r;
        ans.dp = dp - 1;
        for (int i = 0; i < 26; ++i)
            ans.cc[i] = cc[i] - x.cc[i];
        return ans;
    }
};


void add(st a, st b, ll x) {
    if (x == 0)
        return;
    if (b.dp == 0) {
        for (int i = b.l; i < b.l + x; ++i) {
            ++cc[s[i] - 'a'];
        }
        return;
    }
    st q = a - b;
    a = b;
    b = q;
    if (x >= b.len) {
        for (int i = 0; i < 26; ++i)
            cc[i] += b.cc[i];
        x -= b.len;
        add(b, a - b, x);
    }
    else {
        add(a, b, x);
    }
}

void solve(ll x) {
    int n = strlen(s);
    zz(n);
    int xx = 0;
    for (int i = 1; i < n / 2; ++i)
        if (i + z[i] >= n / 2) {
            xx = i;
            break;
        }
    assert(xx != 0);
    st a(xx, n / 2);
    st b(n / 2 - xx, xx);
    for (int i = 0; i < min((ll)n, x); ++i)
        ++cc[s[i] - 'a'];
    x -= min((ll)n, x);
    if (x == 0)
        return;
    while (x >= b.len + a.len + a.len + b.len) {
        for (int i = 0; i < 26; ++i)
            cc[i] += 2 * a.cc[i] + 2 * b.cc[i];
        x -= 2 * (a.len + b.len);
        st q = a + b;
        b = a;
        a = q;
    }
    st c = a + b;
    if (x >= b.len) {
        for (int i = 0; i < 26; ++i)
            cc[i] += b.cc[i];
        x -= b.len;
    }
    else {
        add(a, b, x);
        return;
    }
    if (x >= a.len) {
        for (int i = 0; i < 26; ++i)
            cc[i] += a.cc[i];
        x -= a.len;
    }
    else {
        add(c, a, x);
        return;
    }
    if (x >= a.len) {
        for (int i = 0; i < 26; ++i)
            cc[i] += a.cc[i];
        x -= a.len;
    }
    else {
        add(c, a, x);
        return;
    }
    if (x >= b.len) {
        for (int i = 0; i < 26; ++i)
            cc[i] += b.cc[i];
        x -= b.len;
    }
    else {
        add(a, b, x);
        return;
    }
}
ll ans[100];

int main() {
    scanf("%s", s);
    ll l, r;
    scanf("%lld%lld", &l, &r);
    --l;
    int n = strlen(s);
    zz(n);
    for (int i = 0; i < n; ++i)
        ++cc[s[i] - 'a'];
    for (int i = 1; i < n / 2; ++i) {
        if (n % i == 0 && i + z[i] >= n) {
            for (int i = 0; i < 26; ++i) {
                ll ans = 0;
                ans += cc[i] * (r / n);
                for (int j = 0; j < r % n; ++j)
                    if (s[j] - 'a' == i)
                        ++ans;
                ans -= cc[i] * (l / n);
                for (int j = 0; j < l % n; ++j)
                    if (s[j] - 'a' == i)
                        --ans;
                cout << ans << "\n";
            }
            return 0;
        }
    }
    n /= 2;
    int x = n;
    for (int i = 1; i < n; ++i) {
        if (i + z[i] >= n) {
            x = i;
            break;
        }
    }
    if (x == n) {
        n *= 2;
        for (int i = 0; i < 26; ++i) {
            ll ans = 0;
            ans += cc[i] * (r / n);
            for (int j = 0; j < r % n; ++j)
                if (s[j] - 'a' == i)
                    ++ans;
            ans -= cc[i] * (l / n);
            for (int j = 0; j < l % n; ++j)
                if (s[j] - 'a' == i)
                    --ans;
            cout << ans << "\n";
        }
        return 0;
    }
    n *= 2;
    for (int i = 0; i < x; ++i) {
        s[n] = s[n - x];
        ++n;
    }
    for (int i = 0; i < x; ++i) {
        s[n + i] = s[i];
    }
    n += x;
    for (int i = 0; i < 26; ++i)
        cc[i] = 0;
    solve(r);
    for (int i = 0; i < 26; ++i)
        ans[i] = cc[i], cc[i] = 0;
    solve(l);
    for (int i = 0; i < 26; ++i)
        ans[i] -= cc[i];
    for (int i = 0; i < 26; ++i)
        cout << ans[i] << "\n";
    return 0;
}




Measured memory_bytes: 3712