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

const int N = 201000;
char str[N];
int f[26][N], n;
int nxt[N], t;

ll calc(int*a, ll p) {
	if(p <= n) return a[p];
	if(p <= (n<<1)) return a[n] + a[p-n];
	ll t0 = n, t1 = n + t;
	ll r0 = a[n], r1 = a[n] + a[t];
	while(t0 + t1 <= p) {
		t0 += t1, r0 += r1;
		swap(t0, t1), swap(r0, r1);
	}
	return r1 + calc(a, p - t1);
}

bool fac;

ll work(int*a, ll p) {
	if(p <= n) return a[p];
	if(p <= (n<<1)) return a[n] + a[p-n];
	if(fac) {
		p -= n;
		return a[n] + (p/t) * a[t] + a[p%t];
	}
	return calc(a, p);
}

int main() {
	scanf("%s", str+1);
	n = strlen(str+1) >> 1;
	for(int i=0;i<26;++i) {
		int*arr = f[i];
		for(int j=1;j<=n;++j)
			arr[j] = arr[j-1] + (str[j] == (i+'a'));
	}
	
	for(int i=2,k=0;i<=n;++i) {
		while(k and str[k+1] != str[i]) k = nxt[k];
		if(str[k+1] == str[i]) ++k;
		nxt[i] = k;
	}
	
	t = n - nxt[n];
	fac = (n%t == 0);
	
	ll l, r; scanf("%lld%lld",&l,&r);
	for(int i=0;i<26;++i)
		printf("%lld ", work(f[i], r) - work(f[i], l-1));
	putchar(10);
	return 0;
}