#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define space putchar(' ')
#define enter putchar('\n')
#define MAXN 200005
#define eps 1e-10
//#define ivorysi
using namespace std;
typedef long long int64;
typedef unsigned int u32;
typedef double db;
template<class T>
void read(T &res) {
    res = 0;T f = 1;char c = getchar();
    while(c < '0' || c > '9') {
    	if(c == '-') f = -1;
    	c = getchar();
    }
    while(c >= '0' && c <= '9') {
    	res = res * 10 + c - '0';
    	c = getchar();
    }
    res *= f;
}
template<class T>
void out(T x) {
    if(x < 0) {x = -x;putchar('-');}
    if(x >= 10) {
    	out(x / 10);
    }
    putchar('0' + x % 10);
}
struct node {
    int64 c[26],len;
    node() {memset(c,0,sizeof(c));len = 0;}
    friend node operator + (const node &a,const node &b) {
        node r;
        r.len = a.len + b.len;
        for(int i = 0 ; i < 26 ; ++i) r.c[i] = a.c[i] + b.c[i];
        return r;
    }
    friend node operator - (const node &a,const node &b) {
        node r;
        r.len = a.len - b.len;
        for(int i = 0 ; i < 26 ; ++i) r.c[i] = a.c[i] - b.c[i];
        return r;
    }
    friend node operator * (const node &a,const int64 &d) {
        node r = a;
        for(int i = 0 ; i < 26 ; ++i) {
            r.c[i] = r.c[i] * d;
        }
        return r;
    }
}g[MAXN];
char s[MAXN * 2],t[MAXN * 2];
int nxt[MAXN],N;
int st,all;
node Calc(int64 R) {
    if(R > g[all].len && st) {
        node res;
        res = g[st];
        int64 t = (R - g[st].len) / g[st - 1].len;
        res = res + g[st - 1] * t;
        return res + Calc(R - g[st].len - g[st - 1].len * t);
    }
    else if(R <= g[1].len){
        node res;res.len = R;
        for(int i = 1 ; i <= R ; ++i) {
            res.c[s[i] - 'a']++;
        }
        return res;
    }
    else {
        for(int i = all ; i >= 0 ; --i) {
            if(g[i].len <= R) {
                return g[i] + Calc(R - g[i].len);
            }
        }
    }
}
void Solve() {
    scanf("%s",s + 1);
    int64 r,l;
    read(l);read(r);
    N = strlen(s + 1);
    for(int i = 2 ; i <= N ; ++i) {
        int p = nxt[i - 1];
        while(p && s[i] != s[p + 1]) p = nxt[p];
        if(s[i] == s[p + 1]) nxt[i] = p + 1;
        else nxt[i] = 0;
    }
    int p = nxt[N];
    while(p > (N - 1) / 2) p = nxt[p];
    int L = N;
    for(int i = p + 1 ; i <= N - p ; ++i) {
        s[++L] = s[i];
    }
    for(int i = 1 ; i <= L / 2; ++i) {
        g[1].c[s[i] - 'a']++;
    }
    g[1].len = L / 2;
    p = nxt[L / 2];
    g[0].len = L / 2 - p;
    for(int i = 1 ; i <= L / 2 - p ; ++i) {
        t[i] = s[i];
        g[0].c[t[i] - 'a']++;
    }
    for(int i = 2 ; i <= 100 ; ++i) {
        if(g[i - 1].len % (g[i - 1].len - g[i - 2].len) == 0) {all = i - 1;st = i - 1;break;}
        if(g[i - 1].len + g[i - 2].len <= 1e18) g[i] = g[i - 1] + g[i - 2];
        else {all = i - 1;break;}
    }
    if(!all) all = 100;
    node ans = Calc(r) - Calc(l - 1);
    for(int i = 0 ; i < 26 ; ++i) {
        out(ans.c[i]);space;
    }
    enter;
}
int main() {
#ifdef ivorysi
    freopen("f1.in","r",stdin);
#endif
    Solve();
}


Measured memory_bytes: 43648