#include <bits/stdc++.h>
using namespace std;
inline void PrintArrInt(int arr[], int s, int e) {
  for (int i = (s); i <= (e); i++) printf("%d%c", arr[i], i == e ? '\n' : ' ');
}
const int maxn = 100000 + 5;
char str[maxn];
char ans[maxn][20];
char sta[maxn], dsta[maxn];
int top = 0, dtop = 0, alen[maxn], ista[maxn];
int main() {
  scanf("%s", str);
  int len = strlen(str);
  for (int i = (len - 1); i >= (0); i--) {
    if (top == 0 || sta[top] != str[i])
      sta[++top] = str[i], ista[top] = i, dsta[++dtop] = str[i];
    else if (ista[top] != i + 1)
      sta[++top] = str[i], ista[top] = i;
    else {
      if (dtop <= 1 || dsta[dtop - 1] < str[i]) {
        top--;
        if (top == 0 || sta[top] != dsta[dtop]) dtop--;
      } else
        sta[++top] = str[i], ista[top] = i;
    }
    alen[len - i] = top;
    if (top > 10) {
      for (int j = (top); j >= (top - 4); j--) ans[len - i][top - j] = sta[j];
      ans[len - i][5] = ans[len - i][6] = ans[len - i][7] = '.';
      ans[len - i][8] = sta[2];
      ans[len - i][9] = sta[1];
      ans[len - i][10] = 0;
    } else {
      for (int j = (top); j >= (1); j--) ans[len - i][top - j] = sta[j];
      ans[len - i][top] = 0;
    }
  }
  for (int i = (len); i >= (1); i--) printf("%d %s\n", alen[i], ans[i]);
  return 0;
}
