#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (1e+18) + 7;
typedef pair<int, int>P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-6;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

ll mod_pow(ll a, ll n) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%mod;
		a = a * a%mod; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 20;
modint fact[max_n], factinv[max_n];
void init() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };

void Z_algorithm(const string &s, vector<int> &a) {
	int sz = s.size();
	a.resize(sz);
	a[0] = sz;
	int i = 1, j = 0;
	while (i < sz) {
		while (i + j < sz&&s[j] == s[i + j])++j;
		a[i] = j;
		if (j == 0) { ++i; continue; }
		int k = 1;
		while (i + k < sz&&k + a[k] < j)a[i + k] = a[k], ++k;
		i += k; j -= k;
	}
}

string s0, s1;

vector<vector<ll>> alfs;

vector<ll> merge(vector<ll> &a, vector<ll> &b) {
	vector<ll> res(26);
	rep(i, 26)res[i] = a[i] + b[i];
	return res;
}
string s;
vector<ll> calc(ll x) {
	vector<ll> res(26, 0);
	if (x <= s.size()) {
		rep(i, x) {
			res[s[i] - 'a']++;
		}
		return res;
	}
	rep(i, alfs.size()) {
		if (x <= alfs[i].back()) {
			assert(i > 2);
			ll len = alfs[i - 1].back();
			//assert(x >= len);
			//cout << "? " << len << endl;
			vector<ll> ad = alfs[i - 1];
			vector<ll> ad2 = calc(x - len);
			res = merge(ad, ad2);
			break;
		}
	}
	//cout << x <<" ! "<< endl;
	//rep(i, 26)cout << res[i] << " ";
	//cout << endl;
	return res;
}
void solve() {
	cin >> s;
	vector<int> a; Z_algorithm(s, a);
	int n = s.size();
	n /= 2;
	int chk = 0;
	Rep(i, n + 1, 2 * n) {
		if (a[i] == 2 * n - i) {
			chk = 2 * n - i; break;
		}
	}
	s0 = s.substr(2 * n - chk, chk);
	s1 = s.substr(n, n - chk);
	int z = s1.size();
	if (n%z == 0) {
		bool c = true;
		rep(i, z) {
			rep(j, n / z) {
				if (s[i + j * z] != s[i])c = false;
			}
		}
		if (c) {
			vector<ll> num(27, 0);
			rep(i, z) {
				num[s[i] - 'a']++;
				num[26]++;
			}
			vector<ll> ans(26, 0);
			ll l, r; cin >> l >> r; l--; r--;
			ll rd = r / z;
			ll rr = r % z;
			rep(i, 26) {
				ans[i] += rd * num[i];
			}
			rep(i, rr + 1)ans[s[i] - 'a']++;
			l--;
			if (l >= 0) {
				rd = l / z;
				rr = l % z;
				rep(i, 26)ans[i] -= rd * num[i];
				rep(i, rr + 1)ans[s[i] - 'a']--;
			}
			rep(i, 26) {
				if (i > 0)cout << " ";
				cout << ans[i];
			}
			cout << endl; return;
		}
	}

	alfs.resize(2);
	alfs[0].resize(27);
	rep(i, s0.size()) {
		alfs[0][s0[i] - 'a']++;
		alfs[0][26]++;
	}
	alfs[1].resize(27);
	rep(i, s1.size()) {
		alfs[1][s1[i] - 'a']++;
		alfs[1][26]++;
	}
	while (alfs.back().back() < INF) {
		int len = alfs.size();
		vector<ll> nex = merge(alfs[len - 2], alfs.back());
		nex.push_back(alfs[len - 2].back() + alfs[len - 1].back());
		alfs.push_back(nex);
		//cout << nex.back() << endl;
	}
	ll l, r; cin >> l >> r;
	vector<ll> ansl = calc(l - 1);
	//cout << "hello" << endl;
	vector<ll> ansr = calc(r);
	rep(i, 26)ansl[i] *= -1;
	vector<ll> ans = merge(ansl, ansr);
	rep(i, 26) {
		if (i > 0)cout << " ";
		cout << ans[i];
	}
	cout << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(7);
	//init();
	//int t; cin >> t; rep(i, t)solve();
	solve();
	stop
		return 0;
}


Measured memory_bytes: 17812