#include <bits/stdc++.h>
using namespace std;
string convert(const string& s, int sz) {
  if (sz <= 10) return s;
  return s.substr(0, 5) + "..." + s.substr(s.size() - 2, 2);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  int n = (int)s.size();
  vector<int> chain(n);
  vector<bool> better_to_remove(n, false);
  vector<string> ans(n + 1);
  vector<int> sz(n + 1);
  vector<char> first(n);
  auto remove = [&](int i, int j) {
    sz[i] = sz[j] + chain[i] % 2;
    ans[i] = convert(string(chain[i] % 2, s[i]) + ans[j], sz[i]);
    better_to_remove[i] = (chain[i] % 2 ? true : better_to_remove[j]);
  };
  auto keep = [&](int i, int j) {
    sz[i] = sz[j] + chain[i];
    ans[i] = convert(string(min(10, chain[i]), s[i]) + ans[j], sz[i]);
  };
  for (int i = n - 1; i >= 0; --i) {
    chain[i] = 1;
    if (i != n - 1 && s[i + 1] == s[i]) chain[i] += chain[i + 1];
    int j = i + chain[i];
    if (j == n || first[j] == '-') {
      remove(i, j);
    } else {
      if (first[j] < s[i]) {
        remove(i, j);
      } else if (first[j] == s[i]) {
        if (better_to_remove[j])
          remove(i, j);
        else
          keep(i, j);
      } else {
        keep(i, j);
      }
    }
    first[i] = (ans[i].size() ? ans[i][0] : '-');
  }
  for (int i = 0; i < n; ++i) {
    cout << sz[i] << ' ' << ans[i] << '\n';
  }
}
