#include <bits/stdc++.h>
using namespace std;
int len[100005], lt[100005];
string res[100005];
bool removed[100005];
void add(string &s, char c) {
  if (s.empty()) {
    lt[0] = -1;
  } else {
    if (s.back() == c)
      lt[s.size()] = lt[s.size() - 1];
    else
      lt[s.size()] = s.back();
  }
  s += c;
}
int main() {
  string s;
  cin >> s;
  int n = s.size();
  string cur = "";
  for (int i = n - 1; i >= 0; i--) {
    if (i + 1 < n && !removed[i + 1] && s[i] == s[i + 1]) {
      if (cur.size() > 0) {
        if (lt[cur.size() - 1] < (int)s[i]) {
          removed[i] = 1;
          cur.pop_back();
        } else
          add(cur, s[i]);
      } else {
        removed[i] = 1;
        cur.pop_back();
      }
    } else
      add(cur, s[i]);
    if (cur.size() > 10) {
      for (int j = 0; j < 5; j++) res[i] += cur[cur.size() - 1 - j];
      res[i] += "...";
      res[i] += cur[1];
      res[i] += cur[0];
    } else {
      for (int j = cur.size() - 1; j >= 0; j--) res[i] += cur[j];
    }
    len[i] = (int)cur.size();
  }
  for (int i = 0; i < n; i++) cout << len[i] << " " << res[i] << endl;
}
