#include <bits/stdc++.h>
using namespace std;
struct READ {
  inline char read() {
    const int LEN = 1 << 18 | 1;
    static char buf[LEN], *s, *t;
    return (s == t) && (t = (s = buf) + fread(buf, 1, LEN, stdin)),
           s == t ? -1 : *s++;
  }
  inline READ &operator>>(char *s) {
    char ch;
    while (isspace(ch = read()) && ~ch)
      ;
    while (!isspace(ch) && ~ch) *s++ = ch, ch = read();
    *s = '\0';
    return *this;
  }
  inline READ &operator>>(string &s) {
    s = "";
    char ch;
    while (isspace(ch = read()) && ~ch)
      ;
    while (!isspace(ch) && ~ch) s += ch, ch = read();
    return *this;
  }
  template <typename _Tp>
  inline READ &operator>>(_Tp &x) {
    char ch, flag;
    for (ch = read(), flag = 0; !isdigit(ch) && ~ch; ch = read())
      flag |= ch == '-';
    for (x = 0; isdigit(ch); ch = read()) x = x * 10 + (ch ^ '0');
    flag && (x = -x);
    return *this;
  }
} in;
const int N = 2e5 + 50;
char s[N];
vector<int> aa;
vector<string> ans;
char now[N];
int pos[N];
int pre[30];
int main() {
  in >> s + 1;
  int n = strlen(s + 1);
  int last;
  int len = 0;
  memset(pre, -1, sizeof(pre));
  for (int i = n; i >= 1; i--) {
    if (len == 0) {
      now[++len] = s[i];
      pos[len] = i;
    } else if (len == 1) {
      if (s[i] == now[len] && pos[len] == i + 1) {
        len = 0;
      } else {
        if (s[i] != now[len]) pre[s[i] - 'a'] = now[len] - 'a';
        now[++len] = s[i];
        pos[len] = i;
      }
    } else {
      if (s[i] == now[len] && pos[len] == i + 1) {
        if (s[i] - 'a' > pre[s[i] - 'a']) {
          len--;
        } else
          now[++len] = s[i], pos[len] = i;
      } else {
        if (s[i] != now[len]) pre[s[i] - 'a'] = now[len] - 'a';
        now[++len] = s[i];
        pos[len] = i;
      }
    }
    if (len > 10) {
      string tmp = "";
      for (int i = len; i >= len - 4; i--) tmp = tmp + now[i];
      for (int i = 1; i <= 3; i++) tmp = tmp + '.';
      for (int i = 2; i >= 1; i--) tmp = tmp + now[i];
      ans.push_back(tmp);
      aa.push_back(len);
    } else {
      string tmp = "";
      for (int i = len; i >= 1; i--) tmp = tmp + now[i];
      ans.push_back(tmp);
      aa.push_back(len);
    }
  }
  for (int i = ans.size() - 1; i >= 0; i--) {
    cout << aa[i] << " " << ans[i] << '\n';
  }
  return 0;
}
