#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
const int N = 2e5 + 5; 
typedef long long ll;
typedef unsigned int ui;
const ui p = 19260817; 
using namespace std;

int n, Pos; 
ll s[105][30], b[105][30], a[105][30], cnt[30], L, R; 
ui pw[N], hashh[N]; 
char S[N]; 

template < typename T >
inline T read()
{
	T x = 0, w = 1; char c = getchar();
	while(c < '0' || c > '9') { if(c == '-') w = -1; c = getchar(); }
	while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return x * w; 
}

ui gethashh(int l, int r)
{
	int len = r - l + 1; 
	return hashh[r] - hashh[l - 1] * pw[len]; 
}

void prepare()
{
	for(int i = (pw[0] = 1); i <= n; i++) pw[i] = pw[i - 1] * p;
	for(int i = 1; i <= n; i++) hashh[i] = hashh[i - 1] * p + (S[i] - 'a' + 1);
	Pos = 0; 
	for(int i = 1; i < n / 2; i++)
		if(gethashh(1, i) == gethashh(n - i + 1, n)) Pos = i; 
	for(int i = 1; i <= Pos; i++) s[0][0]++, s[0][S[i] - 'a' + 1]++; 
	for(int i = Pos + 1; i <= n / 2; i++) a[0][0]++, a[0][S[i] - 'a' + 1]++; 
	for(int i = n / 2 + 1; i <= n - Pos; i++) b[0][0]++, b[0][S[i] - 'a' + 1]++; 
}

void calc(ll x, int op, int pos, int type)
{
	if(!x) return; 
	if(!pos)
	{
		if(!type)
			for(int i = 1; i <= x; i++) cnt[S[i] - 'a' + 1] += op; 
		else if(type == 1)
			for(int i = Pos + 1; i <= Pos + x; i++) cnt[S[i] - 'a' + 1] += op; 
		else for(int i = n / 2 + 1; i <= n / 2 + x; i++) cnt[S[i] - 'a' + 1] += op; 
		return; 
	}
	if(!type)
	{
		if(x >= s[pos][0])
		{
			x -= s[pos][0]; 
			for(int j = 1; j <= 26; j++) cnt[j] += s[pos][j] * op; 
			type = 1; if(!x) return; 
		}
		else return calc(x, op, pos - 1, 2); 
	}
	if(type == 1)
	{
		if(x >= a[pos][0])
		{
			x -= a[pos][0]; 
			for(int j = 1; j <= 26; j++) cnt[j] += a[pos][j] * op; 
			type = 2; if(!x) return; 
		}
		else
		{
			if(x >= s[pos - 1][0])
			{
				x -= s[pos - 1][0]; 
				for(int j = 1; j <= 26; j++) cnt[j] += s[pos - 1][j] * op; 
				return calc(x, op, pos - 1, 2); 
			}
			else return calc(x, op, pos - 1, 0); 
		}
	}
	if(type == 2)
	{
		if(x >= b[pos][0])
		{
			x -= b[pos][0]; 
			for(int j = 1; j <= 26; j++) cnt[j] += b[pos][j] * op; 
			type = 0; if(!x) return; 
		}
		else
		{
			if(x >= b[pos - 1][0])
			{
				x -= b[pos - 1][0]; 
				for(int j = 1; j <= 26; j++) cnt[j] += b[pos - 1][j] * op; 
				return calc(x, op, pos - 1, 0); 
			}
			else return calc(x, op, pos - 1, 2); 
		}
	}
	if(!type)
	{
		if(x >= s[pos][0])
		{
			x -= s[pos][0]; 
			for(int j = 1; j <= 26; j++) cnt[j] += s[pos][j] * op; 
			type = 1; if(!x) return; 
		}
		else return calc(x, op, pos - 1, 2); 
	}
}

void solve(ll L, ll R, int id) { calc(R, 1, id, 0), calc(L - 1, -1, id, 0); }

int main()
{
#ifndef ONLINE_JUDGE
	freopen("cpp.in", "r", stdin), freopen("cpp.out", "w", stdout); 
#endif
	scanf("%s", S + 1), n = strlen(S + 1); 
	prepare(), L = read <ll> (), R = read <ll> (); 
	for(int i = 1; i <= 92; i++)
	{
		for(int j = 0; j <= 26; j++)
			s[i][j] = b[i - 1][j], b[i][j] = b[i - 1][j] + s[i - 1][j], a[i][j] = s[i - 1][j] + b[i - 1][j];
		if(1.0 * -R + s[i][0] + a[i][0] + b[i][0] + s[i][0] >= 0)
		{
			solve(L, R, i); break;
		}
	}
	for(int i = 1; i <= 26; i++) printf("%lld%c", cnt[i], i == 26 ? '\n' : ' '); 
	return 0; 
}


Measured memory_bytes: 5032