#include<bits/stdc++.h>
using namespace std;
#define N 1111116
#define next nxt

int n,k,next[N];
char s[N];
long long l,r,ans[256];

void solve(long long m,long long t){
	if (m<=n){
		for (int i=1;i<=m;i++) ans[s[i]]+=t;
		return;
	}
	long long a0=1,b0=0,a1=1,b1=1;
	while (a1*k+b1*(n-k)<=m){
		a1+=a0;a0=a1-a0;
		b1+=b0;b0=b1-b0;
	}
	for (int i=1;i<=k;i++) ans[s[i]]+=t*a0;
	for (int i=k+1;i<=n;i++) ans[s[i]]+=t*b0;
	solve(m-a0*k-b0*(n-k),t);
}

long long read(){
	long long x=0,f=1;char ch=getchar();
	for (;!isdigit(ch);ch=getchar()) if (ch=='-')  f=-f;
	for (;isdigit(ch);ch=getchar()) x=x*10+ch-'0';
	return x*f;
}

int main(){
	scanf(" %s",s+1);n=strlen(s+1)/2;
	l=read();r=read();
	for (int i=2,j=0;i<=n;i++){
		while (j&&s[i]!=s[j+1]) j=next[j];
		next[i]=(j+=(s[i]==s[j+1]));
	}
	k=n-next[n];solve(l-1,-1);solve(r,1);
	for (int i='a';i<='z';i++)
		printf((i!='z')?"%lld ":"%lld\n",ans[i]);
	return 0;
}