/**
 *    author:  tourist
 *    created: 17.11.2019 02:41:48       
**/
#include <bits/stdc++.h>

using namespace std;

template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

template <typename T>
vector<int> kmp_table(int n, const T &s) {
  vector<int> p(n, 0);
  int k = 0;
  for (int i = 1; i < n; i++) {
    while (k > 0 && !(s[i] == s[k])) {
      k = p[k - 1];
    }
    if (s[i] == s[k]) {
      k++;
    }
    p[i] = k;
  }
  return p;
}

template <typename T>
vector<int> kmp_table(const T &s) {
  return kmp_table((int) s.size(), s);
}

template <typename T>
vector<int> kmp_search(int n, const T &s, int m, const T &w, const vector<int> &p) {
  assert(n >= 1 && (int) p.size() == n);
  vector<int> res;
  int k = 0;
  for (int i = 0; i < m; i++) {
    while (k > 0 && (k == n || !(w[i] == s[k]))) {
      k = p[k - 1];
    }
    if (w[i] == s[k]) {
      k++;
    }
    if (k == n) {
      res.push_back(i - n + 1);
    }
  }
  return res;
  // returns 0-indexed positions of occurrences of s in w
}

template <typename T>
vector<int> kmp_search(const T &s, const T &w, const vector<int> &p) {
  return kmp_search((int) s.size(), s, (int) w.size(), w, p);
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  if (s.size() == 1) s += s;
  long long L, R;
  cin >> L >> R;
  vector<int> pers;
  vector<string> sss(1, s);
  while (true) {
    vector<int> p = kmp_table(s);
    int n = (int) s.size();
    int x = p[n - 1];
    while (x >= n / 2) {
      x = p[x - 1];
    }
    s += s.substr(x, n - 2 * x);
    pers.push_back(n - x);
    debug(s, pers);
    sss.push_back(s);
    if (pers.size() == 5) break;
  }
  string A = sss[3];
  string B = sss[4];
  vector<long long> len(2);
  vector<vector<long long>> cnt(2, vector<long long>(26));
  for (char c : A) {
    len[0] += 1;
    cnt[0][c - 'a'] += 1;
  }
  for (char c : B) {
    len[1] += 1;
    cnt[1][c - 'a'] += 1;
  }
  while (len.back() < R) {
    len.push_back(len.back() + len[len.size() - 2]);
    cnt.emplace_back(26, 0);
    for (int i = 0; i < 26; i++) cnt.back()[i] = cnt[cnt.size() - 3][i] + cnt[cnt.size() - 2][i];
  }
  vector<long long> res(26);
  function<void(long long, long long)> Fun = [&](long long L, long long R) {
    int id = 0;
    while (len[id] < R) {
      ++id;
    }
    if (id == 0) {
      for (int i = L; i <= R; i++) res[A[i - 1] - 'a'] += 1;
      return;
    }
    if (id == 1) {
      for (int i = L; i <= R; i++) res[B[i - 1] - 'a'] += 1;
      return;
    }
    if (L == 1 && R == len[id]) {
      for (int i = 0; i < 26; i++) res[i] += cnt[id][i];
      return;
    }
    if (L > len[id - 1]) {
      Fun(L - len[id - 1], R - len[id - 1]);
    } else {
      Fun(L, len[id - 1]);
      Fun(1, R - len[id - 1]);
    }
  };
  Fun(L, R);
  for (int i = 0; i < 26; i++) cout << res[i] << " ";
  return 0;
}


Measured memory_bytes: 16568