#include <bits/stdc++.h>
using namespace std;
const int N = int(3e5) + 12, mod = int(1e9) + 7;
char second[N];
string ans[N];
int len[N], last[N], ls[N];
void solve() {
  scanf("%s", second + 1);
  int n = strlen(second + 1);
  for (int i = 0; i < 26; i++) last[i] = n + 1;
  ls[n + 1] = 1;
  for (int i = n; i > 0; i--) {
    if (second[i] == second[i + 1]) {
      int mx = n + 1;
      for (int j = 0; j < 26; j++) {
        if ((second[i] - 'a') != j) mx = min(last[j], mx);
      }
      if (len[mx] == 0 || ans[mx][0] < second[i] ||
          (ans[mx][0] == second[i] && ls[mx])) {
        if ((mx - i) % 2 == 0) {
          len[i] = len[mx];
          ans[i] = ans[mx];
          ls[i] = ls[mx];
        } else {
          len[i] = len[mx] + 1;
          ans[i] = "";
          ans[i] += second[i];
          if (len[mx] == 0)
            ls[i] = 1;
          else if (second[i] == ans[mx][0])
            ls[i] = ls[mx];
          else
            ls[i] = (second[i] > ans[mx][0]);
          if (ans[mx].size() < 10)
            ans[i] += ans[mx];
          else if (ans[mx].size() == 10) {
            for (int j = 0; j < 10; j++) {
              if (j < 4 || j > 7) {
                ans[i] += ans[mx][j];
                continue;
              }
              if (j == 4) continue;
              ans[i] += '.';
            }
          } else
            for (int j = 0; j < 10; j++)
              if (j != 4) ans[i] += ans[mx][j];
        }
      } else {
        len[i] = mx - i + len[mx];
        if (len[mx] == 0)
          ls[i] = 1;
        else if (second[i] == ans[mx][0])
          ls[i] = ls[mx];
        else
          ls[i] = (second[i] > ans[mx][0]);
        if (len[i] <= 10) {
          for (int j = 0; j < mx - i; j++) ans[i] += second[i];
          ans[i] += ans[mx];
        } else {
          while (ans[i].size() < min(mx - i, 5)) ans[i] += second[i];
          int k = 0;
          while (ans[i].size() < 5) ans[i] += ans[mx][k++];
          for (int j = 0; j < 3; j++) ans[i] += '.';
          if (len[mx] >= 2) {
            ans[i] += ans[mx][ans[mx].size() - 2];
            ans[i] += ans[mx][ans[mx].size() - 1];
          } else if (len[mx] == 1) {
            ans[i] += second[i];
            ans[i] += ans[mx][ans[mx].size() - 1];
          } else {
            ans[i] += second[i];
            ans[i] += second[i];
          }
        }
      }
    } else {
      int mx = i + 1;
      if (len[mx] == 0)
        ls[i] = 1;
      else if (second[i] == ans[mx][0])
        ls[i] = ls[mx];
      else
        ls[i] = (second[i] > ans[mx][0]);
      len[i] = mx - i + len[mx];
      if (len[i] <= 10) {
        for (int j = 0; j < mx - i; j++) ans[i] += second[i];
        ans[i] += ans[mx];
      } else {
        while (ans[i].size() < min(mx - i, 5)) ans[i] += second[i];
        int k = 0;
        while (ans[i].size() < 5) ans[i] += ans[mx][k++];
        for (int j = 0; j < 3; j++) ans[i] += '.';
        if (len[mx] >= 2) {
          ans[i] += ans[mx][ans[mx].size() - 2];
          ans[i] += ans[mx][ans[mx].size() - 1];
        } else if (len[mx] == 1) {
          ans[i] += second[i];
          ans[i] += ans[mx][ans[mx].size() - 1];
        } else {
          ans[i] += second[i];
          ans[i] += second[i];
        }
      }
    }
    last[second[i] - 'a'] = i;
  }
  for (int i = 1; i <= n; i++) {
    printf("%d ", len[i]);
    for (int j = 0; j < ans[i].size(); j++) putchar(ans[i][j]);
    putchar('\n');
  }
}
int main() {
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
