#include <bits/stdc++.h>
using namespace std;
const long long infl = 0x3f3f3f3f3f3f3f3fLL;
const long long infi = 0x3f3f3f3f;
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
const long long mod = 1e9 + 7;
const long long N = 1e3 + 5;
string f(string &s) {
  if (((long long)s.size()) <= 10) {
    string t = s;
    reverse(t.begin(), t.end());
    return t;
  }
  string t;
  for (long long i = ((long long)s.size()) - 1; i >= ((long long)s.size()) - 5;
       i--)
    t += s[i];
  t += "...";
  t += s[1];
  t += s[0];
  return t;
}
void solve() {
  string s;
  cin >> s;
  long long n = ((long long)s.size());
  vector<string> res(n);
  vector<long long> len(n), inc(n);
  string cur;
  vector<long long> curr;
  for (long long i = n - 1; i >= 0; i--) {
    cur += s[i];
    curr.push_back(i);
    long long m = ((long long)cur.size());
    if (m < 2 || cur[m - 1] ^ cur[m - 2]) {
      res[i] = f(cur);
      len[i] = m;
      if (m == 1)
        inc[i] = 0;
      else
        inc[i] = cur[m - 2] > cur[m - 1];
      continue;
    }
    if (!inc[i + 1] && curr[m - 1] == curr[m - 2] - 1) {
      cur.pop_back();
      cur.pop_back();
      curr.pop_back();
      curr.pop_back();
      inc[i] = inc[i + 2];
    } else
      inc[i] = inc[i + 1];
    res[i] = f(cur);
    len[i] = ((long long)cur.size());
  }
  for (long long i = 0; i < n; i++) cout << len[i] << " " << res[i] << '\n';
}
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);
  long long t = 1;
  while (t--) solve();
  return 0;
}
long long powm(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
long long divide(long long a, long long b) {
  return (a % mod) * powm(b, mod - 2) % mod;
}
long long norm(long long a) {
  while (a >= mod) a -= mod;
  while (a < 0) a += mod;
  return a;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
