#include <bits/stdc++.h>
using namespace std;
char ch[110001];
int n;
struct Unit {
  int ln;
  char ns[12];
} a[110001];
char bn[110001];
int bntp, dntp;
char bnlst;
char qn[110001];
int qntp;
int main() {
  scanf("%s", ch + 1);
  n = strlen(ch + 1);
  for (int i = n; i >= 1; i--) {
    bn[++bntp] = ch[i];
    if (i == n || bn[bntp] != bn[bntp - 1]) {
      bnlst = qn[qntp];
      qn[++qntp] = ch[i];
    }
    if (bntp > 1) {
      if (bntp - 1 > dntp && bn[bntp] == bn[bntp - 1] && bnlst < bn[bntp]) {
        bntp -= 2;
        if (bntp == 0) {
          qntp = 0;
          bnlst = 0;
        }
        if (bntp != 0) {
          if (bn[bntp] != ch[i]) {
            qntp--;
            dntp = bntp;
          }
          if (qntp == 1) bnlst = 0;
          if (qntp != 1) bnlst = qn[qntp - 1];
        }
      }
    }
    a[i].ln = bntp;
    if (a[i].ln >= 11) {
      for (int j = 1; j <= 5; j++) a[i].ns[j] = bn[bntp - j + 1];
      for (int j = 6; j <= 8; j++) a[i].ns[j] = '.';
      for (int j = 9; j <= 10; j++) a[i].ns[j] = bn[11 - j];
      continue;
    }
    for (int j = 1; j <= a[i].ln; j++) a[i].ns[j] = bn[bntp - j + 1];
  }
  for (int i = 1; i <= n; i++) printf("%d %s\n", a[i].ln, a[i].ns + 1);
  return 0;
}
