#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
int n;
char s[N];
string ans;
int last = -1, cur = 0;
int sz[N];
string ss[N];
int nxt[N];
int a, b, lll;
int main() {
  scanf("%s", s);
  n = strlen(s);
  for (int i = n - 1; i >= 0; i--) {
    if (i == n - 1) {
      sz[i] = 1;
      ss[i] += s[i];
      cur = 1;
      continue;
    }
    if (s[i] != s[i + 1]) {
      if (cur & 1) {
        if ((int)ans.size() == 0) {
          ans += s[i + 1];
          nxt[0] = -1;
        } else {
          a = ans[(int)ans.size() - 1];
          b = nxt[(int)ans.size() - 1];
          if (b != -1) b = ans[b];
          if (s[i + 1] < a || (s[i + 1] == a && s[i + 1] < b)) {
            for (int j = 0; j < cur; j++) {
              nxt[(int)ans.size()] = (ans[(int)ans.size() - 1] == s[i + 1]
                                          ? nxt[(int)ans.size() - 1]
                                          : (int)ans.size() - 1);
              ans += s[i + 1];
            }
          } else {
            nxt[(int)ans.size()] =
                (ans[(int)ans.size() - 1] == s[i + 1] ? nxt[(int)ans.size() - 1]
                                                      : (int)ans.size() - 1);
            ans += s[i + 1];
          }
        }
        last = (int)ans.size() - 1;
      } else {
        if ((int)ans.size() > 0) {
          a = ans[(int)ans.size() - 1];
          b = nxt[(int)ans.size() - 1];
          if (b != -1) b = ans[b];
          if (s[i + 1] < a || (s[i + 1] == a && s[i + 1] < b)) {
            for (int j = 0; j < cur; j++) {
              nxt[(int)ans.size()] = (ans[(int)ans.size() - 1] == s[i + 1]
                                          ? nxt[(int)ans.size() - 1]
                                          : (int)ans.size() - 1);
              ans += s[i + 1];
            }
          }
        }
      }
      cur = 0;
    }
    cur++;
    int needed;
    a = ans[(int)ans.size() - 1];
    b = nxt[(int)ans.size() - 1];
    if (b != -1) b = ans[b];
    if (cur & 1)
      needed = 1;
    else
      needed = 0;
    if ((int)ans.size() > 0 &&
        (s[i + 1] < a || (s[i + 1] == a && s[i + 1] < b)))
      needed = cur;
    sz[i] = (int)ans.size() + needed;
    if (sz[i] > 10) {
      lll = 5;
      for (int j = 0; j < needed && lll > 0; j++) {
        lll--;
        ss[i] += s[i];
      }
      for (int j = (int)ans.size() - 1; j >= 0 && lll > 0; j--) {
        lll--;
        ss[i] += ans[j];
      }
      ss[i] += "...";
      if ((int)ans.size() == 0) {
        ss[i] += s[i];
        ss[i] += s[i];
      } else if ((int)ans.size() == 1) {
        ss[i] += s[i];
        ss[i] += ans[0];
      } else {
        ss[i] += ans[1];
        ss[i] += ans[0];
      }
    } else {
      for (int j = 0; j < needed; j++) ss[i] += s[i];
      for (int j = (int)ans.size() - 1; j >= 0; j--) ss[i] += ans[j];
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%d %s\n", sz[i], ss[i].c_str());
  }
  return 0;
}
