#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001;

string s;
vector<pair<ll,array<ll,26>>> tmp;

vi z(string s) {
    int N = s.length(); s += '#';
    vi ans(N); ans[0] = N;
    while (s[1+ans[1]] == s[ans[1]]) ans[1] ++;
    
    int L = 1, R = ans[1];
    FOR(i,2,N) {
        if (i <= R) ans[i] = min(R-i+1,ans[i-L]);
        while (s[i+ans[i]] == s[ans[i]]) ans[i] ++;
        if (i+ans[i]-1 > R) L = i, R = i+ans[i]-1;
    }
    return ans;
}

string tr(string s) {
    for (int i = sz(s)/2+1; ; ++i) if (s.substr(i,sz(s)-i) == s.substr(0,sz(s)-i)) {
        return s.substr(0,i)+s.substr(0,i);
    }
}

void prin(string s) {
    cout << sz(s)/2 << " "  << s.substr(0,sz(s)/2) << "\n";
}

string get(string s) {
    vi v = z(s); v.pb(0);
    for (int i = sz(s)/2+1; i <= sz(s); ++i) if (v[i] == sz(s)-i) return s.substr(0,i);
}

pair<ll,array<ll,26>> gen(string a) {
    array<ll,26> z = array<ll,26>();
    for (char c: a) z[c-'a'] ++;
    return {sz(a),z};
}

pair<ll,array<ll,26>> operator+(const pair<ll,array<ll,26>>& l, const pair<ll,array<ll,26>>& r) {
    array<ll,26> z = array<ll,26>(); F0R(i,26) z[i] = l.s[i]+r.s[i];
    return {l.f+r.f,z};
}

string a,b;

pair<ll,array<ll,26>> solve(ll pos, ll len) {
    // cout << pos << " " << len << " " << tmp[pos].f << " " << tmp[pos-1].f << " " << tmp[pos-2].f << "\n";
    if (pos == 0) {
        // exit(0);
        array<ll,26> z = array<ll,26>(); 
        F0R(i,len) z[a[i]-'a'] ++;
        return {len,z};
    } else if (pos == 1) {
        /*cout << pos << " " << len << "\n";
        exit(0);*/
        array<ll,26> z = array<ll,26>(); 
        F0R(i,len) z[b[i]-'a'] ++;
        return {len,z};
    } else {
        if (len <= tmp[pos-1].f) return solve(pos-1,len);
        return tmp[pos-1]+solve(pos-2,len-tmp[pos-1].f);
    }
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> s;
    
    a = get(s);
    tmp.pb(gen(a));
    b = get(a+a);
    tmp.pb(gen(b));
    
    while (tmp.back().f < 1e18) tmp.pb(tmp.back()+tmp[sz(tmp)-2]);
    ll l, r; cin >> l >> r;
    array<ll,26> x = solve(sz(tmp)-1,r).s;
    array<ll,26> y = solve(sz(tmp)-1,l-1).s;
    F0R(i,26) cout << x[i]-y[i] << " ";
    
    /*
    prin(tr(s));
    prin(tr(tr(s)));
    prin(tr(tr(tr(s))));
    prin(tr(tr(tr(tr(s)))));*/
}

// read the question correctly (is y a vowel? what are the exact constraints?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?) ARRAY OUT OF BOUNDSS

Measured memory_bytes: 4784