Problem: String diversity is the number of symbols that occur in the string at least once. Diversity of s will be denoted by d(s). For example , d("aaa")=1, d("abacaba")=3.

Given a string s, consisting of lowercase Latin letters. Consider all its substrings. Obviously, any substring diversity is a number from 1 to d(s). Find statistics about substrings diversity: for each k from 1 to d(s), find how many substrings of s has a diversity of exactly k.

Input

The input consists of a single line containing s. It contains only lowercase Latin letters, the length of s is from 1 to 3·105.

Output

Print to the first line the value d(s). Print sequence t1, t2, ..., td(s) to the following lines, where ti is the number of substrings of s having diversity of exactly i.

Examples

Input

abca


Output

3
4
3
3


Input

aabacaabbad


Output

4
14
19
28
5

Note

Consider the first example.

We denote by s(i, j) a substring of "abca" with the indices in the segment [i, j].

  * s(1, 1) =  "a", d("a") = 1
  * s(2, 2) =  "b", d("b") = 1
  * s(3, 3) =  "c", d("c") = 1
  * s(4, 4) =  "a", d("a") = 1
  * s(1, 2) =  "ab", d("ab") = 2
  * s(2, 3) =  "bc", d("bc") = 2
  * s(3, 4) =  "ca", d("ca") = 2
  * s(1, 3) =  "abc", d("abc") = 3
  * s(2, 4) =  "bca", d("bca") = 3
  * s(1, 4) =  "abca", d("abca") = 3



Total number of substring with diversity 1 is 4, with diversity 2 equals 3, 3 diversity is 3.

Solution (in CPP):

Solution:
#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);
  }
}