#include<cstdio>
#include<cstring>
//f[i] = f[i-1]+f[i-2]
//or f[i] = f[i-1]+s
char s1[200005], s2[400005], s3[800005], s4[1600005], s5[3200005];
long long len[105];
long long all[105][30];
long long cnt[30];
long long before[30],after[30];
int next[3200005];


void exKmp(char s[],int n,int next[]){
    int l = 0, r = 0;
    for(int i = 2; i <= n; i++){
        if(i>r){
            l = i, r = i-1;
            while(r+1<=n && s[r+1]==s[r+1-l+1]) r++;
            next[i] = r-l+1;
        }
        else{
            int k = i-l+1;
            if(i+next[k]-1<r) next[i] = next[k];
            else{
                l = i;
                while(r+1<=n && s[r+1]==s[r+1-l+1]) r++;
                next[i] = r-l+1;
            }
        }
    }
}
//return new size
int getNextString(char s[],char t[],int n){
    exKmp(s,n,next);
    //for(int i = 1; i <= n; i++) printf("next[%d] = %d\n",i,next[i]);
    int find = n+1;
    for(int i = n/2+2; i <= n; i++){
        if(next[i]==(n-i+1)){
            find = i;
            break;
        }
    }
    int size = 0;
    for(int rnd = 0; rnd < 2; rnd++){
        for(int i = 1; i <= find-1; i++) t[++size] = s[i];
    }
    t[size+1] = '\0';
    return size;
}

void getRegular(long long cycle,long long n,long long upper,long long keep[]){
    if(upper<=n){
        for(int i = 1; i <= 26; i++) keep[i] = 0;
        for(int i = 1; i <= upper; i++){
            int u = s1[i]-'a'+1;
            keep[u]++;
        }
    }
    else{
        for(int i = 1; i <= 26; i++) cnt[i] = 0;
        for(int i = 1; i <= cycle; i++){
            int u = s1[i]-'a'+1;
            cnt[u]++;
        }
        long long time = (upper-n)/cycle;
        long long left = (upper-n)-time*cycle;
        for(int i = 1; i <= 26; i++) keep[i] = time*cnt[i];
        for(int i = 1; i <= left; i++){
            int u = s1[i]-'a'+1;
            keep[u]++;
        }
        for(int i = 1; i <= n; i++){
            int u = s1[i]-'a'+1;
            keep[u]++;
        }
    }
}

void getFib(long long upper,long long keep[]){
    //printf("upper = %lld\n",upper);
    if(upper<=len[5]){
        for(int i = 1; i <= upper; i++){
            int u = s5[i]-'a'+1;
            keep[u]++;
        }
    }
    else{
        int p = 1;
        while(len[p]<upper) p++;
        int last = p-1;
        for(int i = 1; i <= 26; i++) keep[i] += all[last][i];
        upper -= len[last];
        getFib(upper,keep);
    }
}

int main(){
    scanf("%s",s1+1);
    long long l,r;
    scanf("%lld%lld",&l,&r);
    int size1 = strlen(s1+1);
    int size2 = getNextString(s1,s2,size1);
    int size3 = getNextString(s2,s3,size2);
    int size4 = getNextString(s3,s4,size3);
    int size5 = getNextString(s4,s5,size4);
    //printf("size1 = %d, size2 = %d, size3 = %d, size4 = %d\n",size1,size2,size3,size4);
    //printf("%s\n%s\n%s\n%s\n",s1+1,s2+1,s3+1,s4+1);
    if((size2-size1)==(size3-size2) && (size4-size3)==(size3-size2)){
        int cycle = size2-size1;
        getRegular(cycle,size1,l-1,before);
        getRegular(cycle,size1,r,after);
    }
    else{
        len[1] = size1, len[2] = size2, len[3] = size3, len[4] = size4, len[5] = size5;
        for(int i = 1; i <= size1; i++){
            int u = s1[i]-'a'+1;
            all[1][u]++;
        }
        for(int i = 1; i <= size2; i++){
            int u = s2[i]-'a'+1;
            all[2][u]++;
        }
        for(int i = 1; i <= size3; i++){
            int u = s3[i]-'a'+1;
            all[3][u]++;
        }
        for(int i = 1; i <= size4; i++){
            int u = s4[i]-'a'+1;
            all[4][u]++;
        }
        for(int i = 1; i <= size5; i++){
            int u = s5[i]-'a'+1;
            all[5][u]++;
        }
        //int find = -1;
        for(int i = 6; ; i++){
            len[i] = len[i-1]+len[i-2];
            for(int j = 1; j <= 26; j++) all[i][j] = all[i-1][j]+all[i-2][j];
            if(len[i]>=r){ 
                //find = i;
                break;
            }
            //printf("len[%d] = %lld\n",i,len[i]);
            //for(int j = 1; j <= 26; j++) printf("%lld ",all[i][j]);
            //printf("\n");
        }
        //for(int i = 1; i <= find; i++) printf("len[%d] = %lld\n",i,len[i]);
        getFib(l-1,before);
        getFib(r,after);
    }
    /*for(int i = 1; i <= 26; i++) printf("%lld ",before[i]);
    printf("\n");
    for(int i = 1; i <= 26; i++) printf("%lld ",after[i]);
    printf("\n");*/
    for(int i = 1; i <= 26; i++) printf("%lld ",after[i]-before[i]);
    printf("\n");
    return 0;
}
/*
aedcaaedca
565
199 0 122 122 122 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
//cnt[a]?
aedcaaedca
251 565
*/


Measured memory_bytes: 9336