#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const vector<int> mods = {998244353, 1000000007, 1000000009};
const long long inf = 3e18;
const double pi = acos(-1.0);
const double eps = 0.0000001;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <class... K>
using umap = unordered_map<K...>;
template <class... K>
using uset = unordered_set<K...>;
const int N = 100100;
long long n, curl;
string s;
string cur;
vector<long long> wish;
string res[N];
long long rl[N];
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout.precision(13);
  cin >> s;
  n = ((int)(s).size());
  bool wk = 0;
  for (long long i = n - 1; i >= 0; i--) {
    cur += s[i];
    wish.push_back(0);
    long long nn = ((int)(cur).size());
    if (nn >= 2 && cur[nn - 1] > cur[nn - 2]) wish[nn - 1] = 1;
    if (nn >= 2 && cur[nn - 1] == cur[nn - 2]) wish[nn - 1] = wish[nn - 2];
    if (nn == 1) wish[nn - 1] = 1;
    if (!wk && nn >= 2 && cur[nn - 1] == cur[nn - 2] && wish[nn - 1]) {
      for (long long j = (0); j < (2); ++j) {
        cur.pop_back();
        wish.pop_back();
      }
      wk = 1;
    } else {
      wk = 0;
    }
    rl[i] = ((int)(cur).size());
    if (((int)(cur).size()) > 10) {
      string bk = cur.substr(((int)(cur).size()) - 5);
      reverse(begin(bk), end(bk));
      res[i] = bk + "..." + cur[1] + cur[0];
    } else {
      res[i] = cur;
      reverse(begin(res[i]), end(res[i]));
    }
  }
  for (long long i = (0); i < (n); ++i) {
    cout << rl[i] << " " << res[i] << "\n";
  }
  return 0;
}
