#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<vector>
using namespace std;
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
typedef long long LL;
class ele{
	public:
		LL sz,cnt[30];
		ele(){
			sz=0;
			memset(cnt,0,sizeof(cnt));
		}
		ele(LL SZ,char *inp){
			int xb;
			sz=SZ;
			memset(cnt,0,sizeof(cnt));
			for(xb=0;xb<sz;xb++) cnt[inp[xb]-'a']++;
		}
		inline void print(){
			int xb;
		//	printf("Size:%d\t",sz);
			for(xb=0;xb<26;xb++){
				printf("%lld ",cnt[xb]);
			}
			printf("\n");
		}
}firsts[3][200005],res;
char inp[200005],nxt[500005],nnxt[1000005];
int Z[500005],match[500005],ilen,nlen,match2[500005],nnlen,bct[3];
LL L,R;
vector < ele > eles;
ele operator +(const ele &a,const ele &b){
	ele ret=ele();
	ret.sz=a.sz+b.sz;
	int xb;
	for(xb=0;xb<30;xb++) ret.cnt[xb]=a.cnt[xb]+b.cnt[xb];
	return ret;
}
ele operator -(const ele &a,const ele &b){
	ele ret=ele();
	ret.sz=a.sz+b.sz;
	int xb;
	for(xb=0;xb<30;xb++) ret.cnt[xb]=a.cnt[xb]-b.cnt[xb];
	return ret;
}
void zz(char *fa,int *mth){
	int k,l,r,x2,cnt=0,sfa=strlen(fa);
	l=r=-1;
	memset(mth,0,sizeof(mth));
	match[0]=1;
	memset(Z,0,sizeof(Z));
	for(k=1;k<sfa;k++){
		if(k>r || l==-1){
			for(x2=k;x2<sfa && fa[x2]==fa[x2-k];x2++);
			x2-=k-1;
			if(x2>1){
				Z[k]=x2-1;
			}
		}
		else if(Z[k-l]<=r-k){
			Z[k]=Z[k-l];
		}
		else{
			Z[k]=r-k+1;
			for(x2=r+1;x2<sfa && fa[x2]==fa[x2-k];x2++);
			Z[k]+=x2-r-1;
		}
		if(Z[k]+k-1>r){
			r=Z[k]+k-1;
			l=k;
		}
		if(Z[k]<(sfa>>1)) mth[k+Z[k]-1]=MAX(mth[k+Z[k]-1],Z[k]);
	}
}
inline char *gc(int d){
	return (d?((d==1)?nxt:nnxt):inp);
}
inline void cal(char *stt,int d,int len){
	int xb,x2;
	for(xb=0;;xb++){
		int stp=10*xb;
		if(stp<len){
			ele v=ele(10,stt+stp);
			if(xb) v=v+firsts[d][xb-1];
			firsts[d][xb]=v;
		}
		else break;
	}
	bct[d]=xb;
}
ele getele(LL rb,int p){
	if(rb<0) return ele();
	if(rb>=eles[p].sz-1) return eles[p];
	if(p<3){
		rb=MIN(rb,eles[p].sz);
		ele ret;
		if(rb>=10) ret=firsts[p][rb/10-1]; else ret=ele();
		int xb;
		for(xb=(LL)((LL)rb/10LL)*10LL;xb<=rb;xb++) ret.cnt[gc(p)[xb]-'a']++;
//		printf("Result of getting %d from %d :",rb,p+1);
//		ret.print();
		return ret;
	}
	
	ele ret=getele(rb,p-1);
//	printf("Fetching position %d of operation %d---first\n",rb,p+1);
//	printf("\t");
//	ret.print();
	if(rb>=eles[p-1].sz) ret=ret+getele(rb-eles[p-1].sz,p-2);
//	printf("Fetching position %d of operation %d---final\n",rb,p+1);
//	printf("\t");
//	ret.print();
	return ret;
}
int main(){
	scanf("%s",inp);
	scanf("%lld %lld",&L,&R);
	L--;
	R--;
	zz(inp,match);
	ilen=strlen(inp);
	memcpy(nxt,inp,sizeof(inp));
	memcpy(nxt+ilen,inp+match[ilen-1],sizeof(char)*(ilen-(match[ilen-1]<<1)));
	nlen=strlen(nxt);
	zz(nxt,match2);
	memcpy(nnxt,nxt,sizeof(nxt));
	memcpy(nnxt+nlen,nxt+match2[nlen-1],sizeof(char)*(nlen-(match2[nlen-1]<<1)));
	nnlen=strlen(nnxt);
	eles.resize(3);
	int xb,x2;
	eles[0]=ele((ilen>>1),inp);
	eles[1]=ele((nlen>>1),nxt);
	eles[2]=ele((nnlen>>1),nnxt);
//	for(xb=0;xb<3;xb++) {
//		printf("Opr %d:",xb+1);
//		eles[xb].print();
//	}
	while(eles.back().sz<=R){
		eles.push_back(eles.back()+eles[eles.size()-2]);
//		printf("Opr %d:",eles.size());
//		eles.back().print();
	}
//	printf("Number of operations %d\n",eles.size());
	cal(inp,0,ilen);
	cal(nxt,1,nlen);
	cal(nnxt,2,nnlen);
	res=getele(R,eles.size()-1)-getele(L-1,eles.size()-1);
	res.print();
	return 0;
}

Measured memory_bytes: 152832