#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 20;
struct node {
  string pre, suf;
  int siz, inc;
  node() {
    pre = "", suf = "";
    siz = inc = 0;
  }
  void plus(char x) {
    if (pre.size() && x != pre[0]) inc = (x < pre[0]);
    siz++;
    if (suf.size() < 2) suf = x + suf;
    pre = x + pre;
    if (pre.size() > 10) pre.erase(pre.end() - 1);
  }
} ans[N];
char s[N];
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  ans[n].plus(s[n]);
  for (int i = n - 1; i >= 1; i--) {
    if (s[i] != s[i + 1]) {
      ans[i] = ans[i + 1];
      ans[i].plus(s[i]);
    } else {
      ans[i] = ans[i + 2];
      if (s[i] < ans[i].pre[0]) {
        ans[i].plus(s[i]);
        ans[i].plus(s[i]);
      } else if (s[i] == ans[i].pre[0] && ans[i].inc) {
        ans[i].plus(s[i]);
        ans[i].plus(s[i]);
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%d ", ans[i].siz);
    if (ans[i].siz <= 10)
      printf("%s\n", (ans[i].pre).c_str());
    else {
      for (int j = 0; j < 5; j++) putchar(ans[i].pre[j]);
      printf("...");
      for (int j = 0; j < 2; j++) putchar(ans[i].suf[j]);
      printf("\n");
    }
  }
  return 0;
}
