#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  string ss;
  ss += s[0];
  int cnt = 1;
  for (int i = 1; i < s.size(); i++) {
    string s1 = "";
    int j = i;
    s1 += s[j++];
    while (ss == s1 && j < s.size()) {
      s1 += s[j++];
    }
    i = j - 1;
    cout << ss << ", " << s1 << "  ";
    if (ss != s1) cnt++;
    ss = s1;
    cout << cnt << endl;
  }
  cout << cnt << endl;
  return 0;
}
