#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
const double PI = atan(1.0) * 4;
const int di[4] = {-1, 0, 1, 0};
const int dj[4] = {0, -1, 0, 1};
const long long INF = (long long)2e18 + 50;
const int maximum = numeric_limits<int>::max();
const int minimum = numeric_limits<int>::min();
const int N = 1e9;
const int mod = 1e9 + 7;
char s[100005];
char pnxt[100005];
string res[100005];
int len[100005];
long long power(long long a, long long e) {
  long long res = 1LL;
  while (e > 0) {
    if (e % 2 == 1) res = res * a;
    a = a * a;
    e /= 2;
  }
  return res;
}
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
string get(const string &s) {
  if (s.length() <= 10) {
    string res = s;
    reverse(res.begin(), res.end());
    return res;
  }
  string res;
  for (int i = 0; i < 5; ++i) {
    res += s[s.length() - 1 - i];
  }
  res += "...";
  res += s[1];
  res += s[0];
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int T;
  T = 1;
  while (T--) {
    string s;
    cin >> s;
    int n = s.length();
    string suf;
    char nxt = '\0';
    pnxt[n] = nxt;
    bool ok = false;
    for (int i = n - 1; i >= 0; i--) {
      if (suf.size() == 0) {
        suf += s[i];
        ok = true;
      } else if (s[i] == suf.back()) {
        if (nxt <= s[i] && ok) {
          suf.pop_back();
          nxt = pnxt[i + 2];
          ok = false;
        } else {
          suf += s[i];
          ok = true;
        }
      } else {
        nxt = suf.back();
        suf += s[i];
        ok = true;
      }
      len[i] = suf.size();
      res[i] = get(suf);
      pnxt[i] = nxt;
    }
    for (int i = 0; i < n; i++) {
      cout << len[i] << " ";
      cout << res[i] << "\n";
    }
  }
  return 0;
}
