#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long expo_pow(long long x, long long y) {
  if (y == 0) return 1;
  y = y % (mod - 1);
  x %= mod;
  if (y == 0) y = mod - 1;
  long long res = 1;
  while (y) {
    if (y & 1) res = (res * x) % mod;
    x = (x * x) % mod;
    y >>= 1;
  }
  return res;
}
long long add() { return 0; }
template <typename T, typename... Types>
T add(T var1, Types... var2) {
  return (((((long long)(var1)) % mod + (long long)(add(var2...))) % mod) +
          mod) %
         mod;
}
long long mul() { return 1; }
template <typename T, typename... Types>
T mul(T var1, Types... var2) {
  return (((long long)(var1)) % mod * (long long)(mul(var2...))) % mod;
}
void solve() {
  string second;
  cin >> second;
  long long n = second.size();
  long long to_remove = 0;
  vector<long long> index;
  vector<char> prev;
  vector<long long> last_rem;
  for (long long i = n - 1; i >= 0; --i) {
    if (last_rem.size() == 0) {
      last_rem.push_back(i);
      prev.push_back('a' - 1);
      continue;
    }
    if (last_rem.back() == i + 1 and second[i] == second[i + 1]) {
      if (second[i] < prev.back()) {
        last_rem.push_back(i);
        prev.push_back(prev.back());
        continue;
      }
      index.push_back(i);
      prev.pop_back();
      last_rem.pop_back();
      to_remove += 2;
    } else {
      if (second[last_rem.back()] == second[i])
        prev.push_back(prev.back());
      else
        prev.push_back(second[last_rem.back()]);
      last_rem.push_back(i);
    }
  }
  index.push_back(n + 1);
  sort(index.begin(), index.end());
  string idk;
  long long j = 0;
  for (long long i = 0; i < n; ++i) {
    while (i < n and j < index.size() and i < index[j]) {
      idk.push_back(second[i]);
      i++;
    }
    j++;
    i++;
  }
  long long total = n - to_remove;
  reverse(idk.begin(), idk.end());
  long long some_idx = idk.size() - 1;
  long long k = 0;
  for (long long i = 0; i < n; i++) {
    cout << idk.size() << " ";
    if (idk.size() > 10) {
      for (long long j = 0; j < 5; ++j) cout << idk[idk.size() - 1 - j];
      cout << "...";
      cout << idk[1] << idk[0] << "\n";
    } else {
      reverse(idk.begin(), idk.end());
      cout << idk << "\n";
      reverse(idk.begin(), idk.end());
    }
    if (i == n - 1) break;
    if (k < index.size() and i == index[k]) {
      k++;
      idk.push_back(second[i]);
    } else if (!idk.empty())
      idk.pop_back();
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long test = 1;
  long long i = 1;
  while (test--) {
    solve();
  }
}
