#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int n, rt[maxn], cur[maxn];
char s[maxn];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  vector<pair<int, string>> V;
  stack<int> st;
  string a, b;
  for (int i = n; i; i--) {
    if (a.empty()) {
      st.push(i), a.push_back(s[i]), b.push_back(s[i]);
    } else if (a.back() == s[i] && st.top() == i + 1) {
      if (b.size() == 1 || b[b.size() - 2] < s[i]) {
        a.pop_back(), st.pop();
        if (a.empty() || a.back() ^ s[i]) b.pop_back();
      } else {
        st.push(i), a.push_back(s[i]);
      }
    } else {
      st.push(i), a.push_back(s[i]);
      if (b.back() ^ s[i]) b.push_back(s[i]);
    }
    string str;
    if (a.size() <= 10) {
      str = a, reverse(str.begin(), str.end());
    } else {
      str = {a[a.size() - 1],
             a[a.size() - 2],
             a[a.size() - 3],
             a[a.size() - 4],
             a[a.size() - 5],
             '.',
             '.',
             '.',
             a[1],
             a[0]};
    }
    V.push_back({a.size(), str});
  }
  reverse(V.begin(), V.end());
  for (auto p : V) {
    cout << p.first << " " << p.second << endl;
  }
  return 0;
}
