//by yjz
#include<bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define PB push_back
#define MP make_pair
#define bged(v) (v).begin(),(v).end()
typedef long long ll;
const int Imx=2147483647;
const int mod=1000000007;
const ll Lbig=2e18;
//My own input/output stream
#define geti(x) x=getnum()
#define getii(x,y) geti(x),geti(y)
#define getiii(x,y,z) getii(x,y),geti(z)
#define puti(x) putnum(x),putsp()
#define putii(x,y) puti(x),putnum(y),putsp()
#define putiii(x,y,z) putii(x,y),putnum(z),putsp()
#define putsi(x) putnum(x),putendl()
#define putsii(x,y) puti(x),putnum(y),putendl()
#define putsiii(x,y,z) putii(x,y),putnum(z),putendl()
inline ll getnum()
{
	register ll r=0;register bool ng=0;register char c;c=getchar();
	while(c!='-'&&(c<'0'||c>'9'))c=getchar();
	if(c=='-')ng=1,c=getchar();
	while(c>='0'&&c<='9')r=r*10+c-'0',c=getchar();
	if(ng)r=-r;return r;
}
template <class T> inline void putnum(T x)
{
	if(x<0)putchar('-'),x=-x;
	register short a[20]={},sz=0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1;i>=0;i--)putchar('0'+a[i]);
}
inline void putsp(){putchar(' ');}
inline void putendl(){putchar('\n');}
inline char mygetchar(){register char c=getchar();while(c==' '||c=='\n')c=getchar();return c;}
char s[800111];
ll hs[800111],bs,pw[800111];
int n;
void iniths()
{
	for(int i=1;i<=n;i++)hs[i]=(1ll*hs[i-1]*bs+s[i])%mod;
}
ll calchs(int l,int r)
{
	return ((hs[r]-1ll*hs[l-1]*pw[r-l+1])%mod+mod)%mod;
}
ll l,r;
void nxtstr()
{
	iniths();
	int len=0;
	for(int i=n/2-1;i>=1;i--)
	{
		if(calchs(1,i)==calchs(n-i+1,n))
		{
			len=i;
			break;
		}
	}
	int nn=n-len;
	n=nn+nn;
	for(int i=1;i<=nn+nn;i++)s[i]=s[(i-1)%nn+1];
}
ll ans[26];
int pre[800111][26];
ll dp[200],dpcnt[200][26];
bool type;
void calc(int lv,ll x,int coef)
{
	if(type)
	{
//		cout<<"calc:"<<lv<<" "<<x<<endl;
		if(lv<=1)
		{
			for(int i=0;i<26;i++)ans[i]+=coef*pre[x][i];
			return;
		}
		ll t=dp[lv]/2;
		if(x<=t)calc(lv-1,x,coef);
		else
		{
			for(int i=0;i<26;i++)ans[i]+=coef*(dpcnt[lv][i]/2);
			calc(lv-1,x-t,coef);
		}
	}
	else
	{
		if(x<=n)
		{
			for(int i=0;i<26;i++)ans[i]+=coef*pre[x][i];
			return;
		}
		else
		{
			for(int i=0;i<26;i++)ans[i]+=1ll*coef*pre[n][i]*(x/n);
			calc(lv,x%n,coef);
		}
	}
}
int main()
{
	srand(time(NULL));
	bs=rand()+1000;
	pw[0]=1;
	for(int i=1;i<=800011;i++)pw[i]=1ll*pw[i-1]*bs%mod;
	scanf("%s",s+1);
	n=strlen(s+1);
	int n1=n;
	nxtstr();
	int n2=n;
	nxtstr();
	int n3=n;
	for(int i=1;i<=n;i++)
	{
		for(int j=0;j<26;j++)
		{
			pre[i][j]=pre[i-1][j]+(s[i]=='a'+j);
		}
	}
	if(n3-n2==n2-n1)type=0;
	else type=1;
//	cout<<n<<endl;
//	for(int i=1;i<=n;i++)cout<<s[i];cout<<endl;
	dp[0]=n1;
	dp[1]=n2;
	dp[2]=n3;
	for(int i=0;i<26;i++)
	{
		dpcnt[0][i]=pre[n1][i];
		dpcnt[1][i]=pre[n2][i];
		dpcnt[2][i]=pre[n3][i];
	}
	int mx=0;
	if(type)
	{
		for(int i=3;i<200;i++)
		{
			dp[i]=dp[i-1]+dp[i-2];
//			cout<<i<<" "<<dp[i]<<endl;
			memset(ans,0,sizeof(ans));
			calc(i-1,dp[i]/2,2);
			for(int j=0;j<26;j++)dpcnt[i][j]=ans[j];
//			cout<<ans[j]<<" ";cout<<endl;
			if(dp[i]>1ll*mod*mod)
			{
				mx=i;
				break;
			}
		}
		assert(mx!=0);
	}
	memset(ans,0,sizeof(ans));
	getii(l,r);
	calc(mx,r,1);
	calc(mx,l-1,-1);
	for(int i=0;i<26;i++)cout<<ans[i]<<" ";cout<<endl;
	return 0;
}

Measured memory_bytes: 76160