#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = 0x3f3f3f3f;
const int maxn = 1e5 + 5;
const int mod = 1e9 + 7;
char s[maxn], last[maxn];
int t[maxn];
int len[maxn];
string ans[maxn];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> s;
  int pos = 0, n = strlen(s);
  t[0] = n;
  for (int i = n - 1; i >= 0; i--) {
    t[++pos] = i;
    if (s[i] == s[t[pos - 1]])
      last[pos] = last[pos - 1];
    else
      last[pos] = s[t[pos - 1]];
    if (i == t[pos - 1] - 1 && s[i] == s[i + 1] && last[pos] < s[i]) pos -= 2;
    len[i] = pos;
    if (pos <= 10) {
      for (int j = pos; j >= 1; j--) ans[i] += s[t[j]];
    } else {
      for (int j = 1; j <= 5; j++) ans[i] += s[t[pos - j + 1]];
      ans[i] += "...";
      ans[i] += s[t[2]];
      ans[i] += s[t[1]];
    }
  }
  for (int i = 0; i < n; i++) cout << len[i] << " " << ans[i] << "\n";
  return 0;
}
