#include <bits/stdc++.h>
using namespace std;
inline bool isvowel(char ch) {
  ch = tolower(ch);
  return (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u');
}
inline bool isprime(int n) {
  if (n < 2 || (n % 2 == 0 && n != 2)) return false;
  for (int i = 3; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
string get(string ns) {
  int n = int((ns).size());
  string tmp = "";
  if (n > 10) {
    for (int j = n - 1; j >= n - 5; j--) {
      tmp += ns[j];
    }
    tmp += "...";
    tmp += ns[1];
    tmp += ns[0];
  } else {
    for (int j = n - 1; j >= 0; j--) tmp += ns[j];
  }
  return tmp;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s, tmp = "";
  vector<pair<int, string>> ans;
  cin >> s;
  char nx = '\0';
  vector<char> pnx(int((s).size()) + 1);
  pnx[int((s).size())] = nx;
  bool can = false;
  for (int i = int((s).size()) - 1; i >= 0; i--) {
    if (!int((tmp).size())) {
      tmp += s[i];
      can = true;
    } else if (s[i] == tmp.back()) {
      if (nx <= s[i] && can) {
        can = false;
        nx = pnx[i + 2];
        tmp.pop_back();
      } else {
        tmp += s[i];
        can = true;
      }
    } else {
      can = true;
      nx = tmp.back();
      tmp += s[i];
    }
    pnx[i] = nx;
    int n = int((tmp).size());
    ans.push_back(make_pair(n, get(tmp)));
  }
  reverse(ans.begin(), ans.end());
  for (auto to : ans) cout << to.first << ' ' << to.second << "\n";
  return 0;
}
