#include <bits/stdc++.h>
using namespace std;
pair<int, int> dp[100003];
int vos[100003];
int main() {
  string s;
  cin >> s;
  int n = s.length();
  s = s + 'A';
  dp[n] = make_pair(n, 0);
  dp[n - 1] = make_pair(n - 1, 1);
  vos[n - 1] = 1;
  for (int i = n - 2; i >= 0; i--) {
    if (s[i] == s[i + 1] and
        (s[i] > s[dp[i + 2].first] or
         (s[i] == s[dp[i + 2].first] and vos[dp[i + 2].first]))) {
      dp[i] = dp[i + 2];
      vos[i] = vos[i + 2];
    } else {
      dp[i].first = i;
      dp[i].second = dp[i + 1].second + 1;
      if (s[i] == s[dp[i + 1].first] and vos[dp[i + 1].first] or
          s[i] > s[dp[i + 1].first]) {
        vos[i] = 1;
      }
    }
  }
  int pr = 200003;
  for (int i = 0; i < n; i++) {
    if (dp[i].second == 2) {
      pr = i;
      break;
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", dp[i].second);
    int ind = i;
    if (dp[i].second > 10) {
      for (int j = 0; j < 5; j++) {
        printf("%c", s[dp[ind].first]);
        ind = dp[ind].first + 1;
      }
      printf("...");
      printf("%c%c", s[dp[pr].first], s[dp[dp[pr].first + 1].first]);
    } else {
      for (int j = 0; j < dp[i].second; j++) {
        printf("%c", s[dp[ind].first]);
        ind = dp[ind].first + 1;
      }
    }
    cout << endl;
  }
  return 0;
}
