#include <bits/stdc++.h>
using namespace std;
string s;
pair<int, string> convert(deque<pair<char, char> >& d) {
  string t;
  if (d.size() > 11) {
    for (int i = 0; i < 5; i++) {
      t += d[i].first;
    }
    t += "...";
    for (int i = d.size() - 3; i < d.size() - 1; i++) {
      t += d[i].first;
    }
  } else {
    for (int i = 0; i < d.size() - 1; i++) {
      t += d[i].first;
    }
  }
  return make_pair(d.size() - 1, t);
}
int main() {
  cin >> s;
  char curc = '#';
  int curnum = 0;
  deque<pair<char, char> > out;
  out.push_back({'.', '#'});
  vector<pair<int, string> > ans;
  for (int i = s.size() - 1; i >= 0; i--) {
    char c = s[i];
    char lastc = out.front().first;
    char lastdiffc = out.front().second;
    char newdiffc = lastc == c ? lastdiffc : lastc;
    out.push_front({c, newdiffc});
    if (c == curc) {
      curnum++;
      if (curnum % 2 == 0 && curc > newdiffc) {
        out.pop_front();
        out.pop_front();
      }
    } else {
      curc = c;
      curnum = 1;
    }
    ans.push_back(convert(out));
  }
  for (int i = ans.size() - 1; i >= 0; i--) {
    cout << ans[i].first << ' ' << ans[i].second << endl;
  }
}
