#include <bits/stdc++.h>
const int kN = 1e5 + 10;
std::string s;
inline int read() {
  int f = 1, w = 0;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) w = (w << 3) + (w << 1) + (ch ^ '0');
  return f * w;
}
void Chkmax(int &fir, int sec) {
  if (sec > fir) fir = sec;
}
void Chkmin(int &fir, int sec) {
  if (sec < fir) fir = sec;
}
struct Suffix {
  std::string pre, suf;
  int ans, cmp;
  Suffix() {
    pre = suf = "";
    cmp = false;
  }
  void Insert(char ch_) {
    ++ans;
    if (pre.size() && ch_ != pre[0]) cmp = (ch_ < pre[0]);
    if (suf.size() < 2) suf = ch_ + suf;
    pre = ch_ + pre;
    while (pre.size() > 10) pre.pop_back();
  }
} f[kN];
int main() {
  std::cin >> s;
  int n = s.length() - 1;
  f[n].Insert(s[n]);
  for (int i = n - 1; i >= 0; --i) {
    if (s[i] != s[i + 1]) {
      f[i] = f[i + 1];
      f[i].Insert(s[i]);
      continue;
    }
    f[i] = f[i + 2];
    if (f[i].ans) {
      if (s[i] > f[i].pre[0]) continue;
      if (s[i] == f[i].pre[0] && !f[i].cmp) continue;
      f[i].Insert(s[i]), f[i].Insert(s[i]);
    }
  }
  for (int i = 0; i <= n; ++i) {
    printf("%d ", f[i].ans);
    if (f[i].ans <= 10) {
      std::cout << f[i].pre << "\n";
    } else {
      std::cout << f[i].pre.substr(0, 5) << "..." << f[i].suf << "\n";
    }
  }
  return 0;
}
