#include <bits/stdc++.h>
using namespace std;
__int128 MOD = 212345678987654321LL, P = 1777771, PI = 106955741089659571LL;
long long sum(long long a, long long b) {
  a += b;
  if (a >= MOD) a -= MOD;
  return a;
}
long long mul(__int128 a, __int128 b) { return a * b % MOD; }
const int K = 18;
long long dp[1 << K][K], pw[1 << K];
int n, len[1 << K], nex[1 << K][K];
string s, lst[1 << K];
int jump(int i, int k) {
  int to = nex[i][k];
  if (to == nex[to][0])
    to = nex[to][1];
  else
    to = nex[to][0];
  return to;
}
bool cmp(int p1, int p2) {
  p1 = nex[p1][0];
  p2 = nex[p2][0];
  for (int k = K - 1; k >= 0; k--) {
    if (dp[p1][k] == dp[p2][k]) p1 = jump(p1, k), p2 = jump(p2, k);
  }
  return s[p1] < s[p2];
}
void print(int pos, int am) {
  for (int i = 0, ThxDem = am; i < ThxDem; ++i) {
    pos = nex[pos][0];
    cout << s[pos];
    pos++;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  pw[0] = 1;
  for (int i = 1, ThxDem = 1 << K; i < ThxDem; ++i) pw[i] = mul(pw[i - 1], P);
  cin >> s;
  n = int(s.size());
  s.push_back(0);
  len[n] = 0;
  for (int k = 0, ThxDem = K; k < ThxDem; ++k)
    nex[n][k] = n, nex[n + 1][k] = n + 1;
  for (int i = n - 1; i >= 0; i--) {
    nex[i][0] = i;
    len[i] = 1 + len[i + 1];
    lst[i] = lst[i + 1];
    if (int(lst[i].size()) <= 1) lst[i] = string(1, s[i]) + lst[i];
    for (int k = 1, ThxDem = K; k < ThxDem; ++k) {
      if (k == 1)
        nex[i][k] = nex[i + 1][0];
      else
        nex[i][k] = nex[jump(i, k - 1)][k - 1];
    }
    dp[i][0] = s[i];
    for (int k = 1, ThxDem = K; k < ThxDem; ++k) {
      dp[i][k] =
          sum(dp[i][k - 1], mul(pw[1 << (k - 1)], dp[jump(i, k - 1)][k - 1]));
    }
    if (s[i] == s[i + 1] && cmp(i + 2, i)) {
      nex[i][0] = nex[i + 2][0];
      len[i] = len[i + 2];
      lst[i] = lst[i + 2];
      for (int k = 0, ThxDem = K; k < ThxDem; ++k) dp[i][k] = dp[i + 2][k];
      for (int k = 1, ThxDem = K; k < ThxDem; ++k) {
        if (k == 1)
          nex[i][k] = nex[i + 2][1];
        else
          nex[i][k] = nex[jump(i, k - 1)][k - 1];
      }
    }
  }
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) {
    cout << len[i] << " ";
    if (len[i] <= 10)
      print(i, len[i]);
    else
      print(i, 5), cout << "..." << lst[i];
    cout << "\n";
  }
}
