#include <bits/stdc++.h>
using namespace std;
int n;
string s, a;
vector<string> risp;
vector<int> lel;
bool v[1000000];
char prec[1000000];
int main() {
  cin >> s;
  n = s.length();
  char c = 0, p = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] != c) p = c, c = s[i];
    if (!v[a.length()] && c > p && a.size() && a.back() == c) {
      a.pop_back();
      if (a.size()) {
        c = a.back();
        if (a.length() == 1)
          p = 0;
        else
          p = prec[a.length() - 1];
        v[a.length()] = 1;
      } else
        c = p = 0;
    } else {
      a += c;
      int i = a.length() - 1;
      if (i == 0)
        prec[i] = 0;
      else if (a[i] == a[i - 1])
        prec[i] = prec[i - 1];
      else
        prec[i] = a[i - 1];
    }
    if (a.length() <= 10) {
      reverse(a.begin(), a.end());
      risp.push_back(a);
      reverse(a.begin(), a.end());
    } else {
      risp.push_back("");
      for (int i = 1; i <= 5; i++) risp.back() += a[a.length() - i];
      risp.back() += "...";
      risp.back() += a[1];
      risp.back() += a[0];
    }
    lel.push_back(a.length());
  }
  for (int i = n - 1; i >= 0; i--) {
    cout << lel[i] << " " << risp[i] << "\n";
  }
}
