#include <bits/stdc++.h>
using namespace std;
int i, j, len, num[300001][26], tmp, s;
long long diver[27];
char str[300001];
int slong[300001];
bool check(int s, int t);
void dfs(int t, int sum);
int main() {
  cin.getline(str, 1000000);
  len = strlen(str);
  memset(num, 0, sizeof(num));
  memset(diver, 0, sizeof(diver));
  memset(slong, 0, sizeof(slong));
  for (i = 0; i < len; i++) {
    for (j = 0; j < 26; j++) num[i + 1][j] = num[i][j];
    tmp = int(str[i]) - 97;
    num[i + 1][tmp]++;
  }
  i = 0;
  while (i < len) {
    tmp = i;
    while (tmp < len) {
      slong[i]++;
      tmp++;
      if (str[tmp] != str[tmp - 1]) break;
    }
    i = tmp;
  }
  for (i = 1; i < len; i++) {
    if (str[i] == str[i - 1]) slong[i] = slong[i - 1] - 1;
  }
  for (i = 0; i < 26; i++)
    if (num[len][i] != 0) diver[0]++;
  for (i = 0; i < len; i++) {
    s = i;
    dfs(i, 0);
  }
  for (i = 0; i <= diver[0]; i++) printf("%I64d\n", diver[i]);
  return 0;
}
bool check(int s, int t) {
  int tmp;
  if (t < s) return false;
  for (int i = 0; i < 26; i++) {
    tmp = num[t + 1][i] - num[s][i];
    if (num[len][i] != 0 && tmp == 0) return false;
  }
  return true;
}
void dfs(int t, int sum) {
  if (t >= len) return;
  if (sum >= diver[0]) {
    diver[diver[0]] = (long long)(diver[sum] + len - t);
    return;
  }
  if (check(s, t - 1)) {
    diver[diver[sum]] = (long long)(diver[sum] + len - t);
    return;
  }
  int x, y;
  x = int(str[t]) - 97;
  y = num[t][x] - num[s][x];
  if (y == 0) {
    diver[sum + 1] = (long long)(diver[sum + 1] + slong[t]);
    dfs(t + slong[t], sum + 1);
  } else {
    diver[sum] = (long long)(diver[sum] + slong[t]);
    dfs(t + slong[t], sum);
  }
}
