#include <bits/stdc++.h>
using namespace std;
const int inv = 1000000000;
const int minv = -inv;
const int max_n = 100000 + 5;
int n;
char s[max_n];
int res[max_n];
string sol[max_n];
string crsol;
int rd[max_n + 1];
bool refkeep[max_n];
string get_sol() {
  int len = ((int)(crsol.length()));
  string ret;
  if (len <= 10)
    ret = crsol;
  else
    ret = crsol.substr(0, 2) + "..." + crsol.substr(len - 5);
  reverse(ret.begin(), ret.end());
  return ret;
}
int main() {
  scanf("%s", s);
  for (n = 0; s[n] != 13 and s[n] != 0; ++n)
    ;
  s[n] = 0;
  bool q;
  crsol = "";
  rd[n] = n;
  res[n] = 0;
  for (int i = n - 1; i > -1; --i) {
    if (i == n - 1 or s[i] != s[i + 1])
      q = false;
    else
      q = (not q);
    if (not q) {
      rd[i] = i;
      res[i] = res[i + 1] + 1;
      crsol += s[i];
      refkeep[i] =
          (rd[i + 1] != n and (s[rd[i + 1]] > s[i] or
                               (s[rd[i + 1]] == s[i] and refkeep[rd[i + 1]])));
    } else if (rd[i + 2] != n and s[rd[i + 2]] == s[i]) {
      if (refkeep[rd[i + 2]]) {
        rd[i] = i;
        res[i] = res[i + 1] + 1;
        crsol += s[i];
        refkeep[i] = true;
      } else {
        rd[i] = rd[i + 2];
        res[i] = res[i + 1] - 1;
        crsol.pop_back();
      }
    } else if (rd[i + 2] != n and s[rd[i + 2]] > s[i]) {
      rd[i] = i;
      res[i] = res[i + 1] + 1;
      crsol += s[i];
      refkeep[i] = true;
    } else {
      rd[i] = rd[i + 2];
      res[i] = res[i + 1] - 1;
      crsol.pop_back();
    }
    sol[i] = get_sol();
  }
  for (int i = 0; i < n; ++i) {
    printf("%d ", res[i]);
    cout << sol[i] << "\n";
  }
  return 0;
}
