#include <bits/stdc++.h>
char s[100005];
int ptr[100005];
int parent[100005];
char tail[100005][2];
int depth[100005];
int vis[100005];
int seq[100005];
int diff[100005];
void printString(int org, int n) {
  int u = org, cnt = 0;
  while (!vis[u]) {
    seq[++cnt] = u;
    u = parent[u];
  }
  int stop = u;
  for (int i = cnt; i >= 1; i--) {
    int u = seq[i];
    depth[u] = depth[stop] + cnt - i + 1;
    vis[u] = 1;
    int p = parent[u];
    if (depth[u] == 1) {
    } else if (depth[u] == 2) {
      tail[u][0] = s[u], tail[u][1] = s[p];
    } else {
      tail[u][0] = tail[p][0], tail[u][1] = tail[p][1];
    }
  }
  printf("%d ", depth[org]);
  if (depth[org] > 10) {
    int u = org;
    for (int i = 1; i <= 5; i++) {
      printf("%c", s[u]);
      u = parent[u];
    }
    printf("...%c%c\n", tail[org][0], tail[org][1]);
  } else {
    int u = org;
    for (int i = 1; i <= depth[org]; i++) {
      printf("%c", s[u]);
      u = parent[u];
    }
    printf("\n");
  }
}
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  s[n + 1] = s[n + 2] = -1;
  char keep[2][2];
  keep[0][0] = s[n + 1], keep[0][1] = s[n + 2];
  ptr[n + 1] = n + 1;
  parent[n + 1] = -1;
  for (int i = n; i >= 1; i--) {
    int u = (n - i + 1) % 2;
    if (i + 1 <= n && s[i] == s[i + 1]) {
      char c = s[i];
      if (c < keep[u][0] || (c == keep[u][0] && c < keep[u][1])) {
        parent[i] = i + 1;
        keep[u][0] = s[i], keep[u][1] = s[i + 1];
        ptr[i] = i;
      } else if (c == keep[u][0] && c == keep[u][1]) {
        char nextC = s[diff[ptr[i + 2]]];
        if (nextC > c) {
          parent[i] = i + 1;
          keep[u][0] = s[i], keep[u][1] = s[i + 1];
          ptr[i] = i;
        } else {
          parent[i] = ptr[i + 1];
          ptr[i] = ptr[i + 2];
        }
      } else {
        parent[i] = ptr[i + 1];
        ptr[i] = ptr[i + 2];
      }
    } else {
      parent[i] = ptr[i + 1];
      keep[u][0] = s[i], keep[u][1] = s[ptr[i + 1]];
      ptr[i] = i;
    }
    if (s[i] != s[parent[i]])
      diff[i] = parent[i];
    else
      diff[i] = diff[parent[i]];
  }
  vis[n + 1] = 1;
  depth[n + 1] = 0;
  for (int i = 1; i <= n; i++) {
    printString(ptr[i], n);
  }
  return 0;
}
