#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string cad;
  cin >> cad;
  long long N = cad.size();
  cad += " ";
  char temp = cad[0];
  long long cont = 1;
  vector<pair<char, long long>> vect;
  for (long long i = 1; i < N + 1; i++) {
    if (cad[i] == temp) {
      cont++;
    } else {
      vect.push_back({temp, cont});
      cont = 1;
      temp = cad[i];
    }
  }
  reverse(vect.begin(), vect.end());
  char fijo = ' ';
  char last = ' ';
  string ttt;
  vector<pair<long long, string>> ans;
  for (auto x : vect) {
    for (long long i = 1; i <= x.second; i++) {
      string res;
      if (x.first < fijo) {
        for (long long j = 1; j <= min(11ll, i); j++) {
          res += x.first;
        }
        if (res.size() < 11ll) {
          for (long long j = (long long)ttt.size() - 1; j >= 0; j--) {
            res += ttt[j];
            if (res.size() == 11) break;
          }
        }
      } else if (x.first == fijo && x.first < last) {
        for (long long j = 1; j <= min(11ll, i); j++) {
          res += x.first;
        }
        if (res.size() < 11ll) {
          for (long long j = (long long)ttt.size() - 1; j >= 0; j--) {
            res += ttt[j];
            if (res.size() == 11) break;
          }
        }
      } else {
        if (i & 1) res += x.first;
        for (long long j = (long long)ttt.size() - 1; j >= 0; j--) {
          res += ttt[j];
          if (res.size() == 11) break;
        }
      }
      if (res.size() <= 10) {
        ans.push_back({res.size(), res});
      } else {
        string ggg = res.substr(0, 5);
        ggg += "...";
        if (ttt.size() >= 2) {
          ggg += ttt[1];
          ggg += ttt[0];
        } else if (ttt.size() >= 1) {
          ggg += x.first;
          ggg += ttt[0];
        } else {
          ggg += x.first;
          ggg += x.first;
        }
        if (x.first < fijo) {
          ans.push_back({i + ttt.size(), ggg});
        } else if (x.first == fijo && x.first < last) {
          ans.push_back({i + ttt.size(), ggg});
        } else {
          if (i & 1)
            ans.push_back({1 + ttt.size(), ggg});
          else
            ans.push_back({ttt.size(), ggg});
        }
      }
    }
    if (x.first < fijo) {
      for (long long i = 0; i < x.second; i++) {
        ttt += x.first;
      }
      if (fijo != x.first) last = fijo;
      fijo = x.first;
    } else if (x.first == fijo && x.first < last) {
      for (long long i = 0; i < x.second; i++) {
        ttt += x.first;
      }
      if (fijo != x.first) last = fijo;
      fijo = x.first;
    } else {
      if (x.second & 1) {
        ttt += x.first;
        if (fijo != x.first) last = fijo;
        fijo = x.first;
      }
    }
  }
  reverse(ans.begin(), ans.end());
  for (auto x : ans) {
    cout << x.first << " ";
    cout << x.second << '\n';
  }
  return 0;
}
