#include <bits/stdc++.h>
using namespace std;

using ll=long long;
#define int ll

#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)
#define MP make_pair
#define PB push_back
#define ALL(x) x.begin(),x.end()
#define REACH ;//<<"reached line "<<__LINE__<<endl
#define DMP(x) ;//<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define ZERO(x) memset(x,0,sizeof(x))

using pi=pair<int,int>;
using vi=vector<int>;
using ld=long double;

template<class T,class U>
ostream& operator<<(ostream& os,const pair<T,U>& p){
	os<<"("<<p.first<<","<<p.second<<")";
	return os;
}

template<class T>
ostream& operator <<(ostream& os,const vector<T>& v){
	os<<"[";
	REP(i,(int)v.size()){
		if(i)os<<",";
		os<<v[i];
	}
	os<<"]";
	return os;
}

int read(){
	int i;
	scanf("%lld",&i);
	return i;
}

void printSpace(){
	printf(" ");
}

void printEoln(){
	printf("\n");
}

void print(int x,int suc=1){
	printf("%lld",x);
	if(suc==1)
		printEoln();
	if(suc==2)
		printSpace();
}

string readString(){
	static char buf[3341919];
	scanf("%s",buf);
	return string(buf);
}

char* readCharArray(){
	static char buf[3341919];
	static int bufUsed=0;
	char* ret=buf+bufUsed;
	scanf("%s",ret);
	bufUsed+=strlen(ret)+1;
	return ret;
}

template<class T,class U>
void chmax(T& a,U b){
	if(a<b)
		a=b;
}

template<class T,class U>
void chmin(T& a,U b){
	if(a>b)
		a=b;
}

template<class T>
T Sq(const T& t){
	return t*t;
}

const int inf=LLONG_MAX/3;

vi KMP(string s){
	int n=s.size();
	vi dp(n+1,-1);
	FOR(i,1,n+1){
		int j=dp[i-1];
		while(j!=-1)
			if(s[j]==s[i-1])break;
			else j=dp[j];
		dp[i]=j+1;
	}
	return dp;
}

struct Kyuridenamida{
	string org;
	vi cnt;
	Kyuridenamida const *s,*t;
	int len;
	Kyuridenamida(string w){
		;//<<"Init "<<w<<endl;
		org=w;
		cnt.resize(26,0);
		for(auto const&c:w)cnt[c-'a']++;
		s=NULL;
		t=NULL;
		len=w.size();
		assert(cnt.size()==26);
	}
	Kyuridenamida(Kyuridenamida const&x,Kyuridenamida const&y){
		cnt.resize(26,0);
		REP(i,26)cnt[i]=x.cnt[i]+y.cnt[i];
		s=&x;
		t=&y;
		len=x.len+y.len;
		assert(cnt.size()==26);
	}
	vi Calc(int x)const{
		;//<<"Call "<<len<<" "<<x<<endl;
		if(s);//<<"ScntSize "<<s->cnt.size()<<endl;
		assert(!s||s->cnt.size()==26);
		assert(x<=len);
		;//<<-2<<endl;
		if(x<=0)return vi(26,0);
		;//<<-1<<endl;
		assert(cnt.size()==26);
		if(x==len)return cnt;
		;//<<0<<endl;
		vi res(26,0);
		if(!s&&!t){
			;//<<1<<endl;
			REP(i,x)res[org[i]-'a']++;
			;//<<2<<endl;
		}else{
			;//<<3<<endl;
			assert(s->cnt.size()==26);
			vi u=s->Calc(min(x,s->len)),v=t->Calc(x-s->len);
			;//<<4<<endl;
			;//<<u<<endl;
			;//<<v<<endl;
			REP(i,26)res[i]=u[i]+v[i];
			;//<<5<<endl;
		}
		return res;
	}
};

signed main(){
	string s=readString();
	int l=read(),r=read(),n=s.size();
	vi kmp=KMP(s);
	int div=n;
	while(div!=-1&&div*2>=n)
		div=kmp[div];
	REP(i,div)s.pop_back();
	n-=div;
	string t=s.substr(0,n-KMP(s).back());
	vector<Kyuridenamida> k;k.reserve(893);
	k.PB(Kyuridenamida(t));
	k.PB(Kyuridenamida(s));
	;//<<893<<endl;
	while(k.back().len<r)k.PB(Kyuridenamida(k[int(k.size())-1],k[int(k.size())-2]));
	;//<<1919<<endl;
	;//<<k[1].len<<" "<<k[1].cnt.size()<<endl;
	vi ans1=k.back().Calc(r);
	vi ans2=k.back().Calc(l-1);
	REP(i,26)print(ans1[i]-ans2[i],i==25?1:2);
}

Measured memory_bytes: 5948