#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
bool umin(T1& a, T2 b) {
  return a > b ? (a = b, true) : false;
}
template <class T1, class T2>
bool umax(T1& a, T2 b) {
  return a < b ? (a = b, true) : false;
}
template <class T>
void clear(T& a) {
  T().swap(a);
}
const int N = 1e5 + 5;
int n, m, _, k;
int a, b, len[N], lens, ne[N];
string s, ans[N], cur;
void solve(int x) {
  cur += s[x];
  if (s[x] != s[a])
    ne[x] = a;
  else
    ne[x] = ne[a];
  b = a;
  a = x;
  len[x] = cur.size();
  if (cur.size() <= 10)
    ans[x] = cur, reverse((ans[x]).begin(), (ans[x]).end());
  else {
    string t = cur.substr(cur.size() - 5, 5);
    reverse((t).begin(), (t).end());
    ans[x] = t + "..." + cur[1] + cur[0];
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> s;
  a = lens = s.size();
  s += char(0);
  ne[lens] = lens;
  for (int i = (lens - 1); i >= (0); --i) {
    if (s[i] != s[i + 1])
      solve(i);
    else if (i + 1 == a && s[ne[i + 1]] < s[i]) {
      a = b;
      cur.pop_back();
      len[i] = len[i + 2];
      ans[i] = ans[i + 2];
    } else
      solve(i);
  }
  for (int i = (0); i <= (lens - 1); ++i)
    cout << len[i] << ' ' << ans[i] << '\n';
  return 0;
}
