#include <bits/stdc++.h>
using namespace std;
int power[100010];
struct str {
  int c, nxt[18], hash[18], len;
} s[100010];
int scnt = 0;
void build(str &ss, int ch, int nx) {
  ss.c = ch;
  ss.nxt[0] = nx;
  ss.len = s[nx].len + 1;
  for (int i = 1; (1 << i) <= ss.len; ++i)
    ss.nxt[i] = s[ss.nxt[i - 1]].nxt[i - 1];
  for (int i = 0; (1 << i) <= ss.len; ++i) ss.hash[i] = ch;
  for (int i = 1; (1 << i) <= ss.len; ++i)
    for (int j = 0, cur = nx; j < i; cur = s[cur].nxt[j], ++j)
      ss.hash[i] =
          (1ll * ss.hash[i] * power[1 << j] % 998244353 + s[cur].hash[j]) %
          998244353;
  return;
}
bool strless(int a, int b) {
  int lcp = 0, l = min(s[a].len, s[b].len);
  int cura = a, curb = b;
  for (int i = 17; i >= 0; --i)
    if (lcp + (1 << i) <= l && s[cura].hash[i] == s[curb].hash[i])
      lcp += (1 << i), cura = s[cura].nxt[i], curb = s[curb].nxt[i];
  if (lcp == s[a].len && lcp == s[b].len) return false;
  if (lcp == s[a].len) return true;
  if (lcp == s[b].len) return false;
  return s[cura].c < s[curb].c;
}
int strmin(int a, int b) { return strless(a, b) ? a : b; }
char ch[100010];
int n, dp[100010];
void print(int cur) {
  int totl = s[cur].len;
  if (totl <= 10) {
    for (; cur != 0; cur = s[cur].nxt[0]) putchar(s[cur].c);
  } else {
    for (int i = 1, curp = cur; i <= 5; ++i, curp = s[curp].nxt[0])
      putchar(s[curp].c);
    printf("...");
    for (int i = 17, pos = totl - 2; i >= 0; --i)
      if (pos & (1 << i)) cur = s[cur].nxt[i];
    putchar(s[cur].c);
    cur = s[cur].nxt[0];
    putchar(s[cur].c);
  }
  return;
}
int main() {
  power[0] = 1;
  for (int i = 1; i < 100010; ++i)
    power[i] = 1ll * power[i - 1] * 19260817 % 998244353;
  scanf("%s", ch + 1);
  n = strlen(ch + 1);
  for (int i = n; i >= 1; --i) {
    if (i + 1 <= n && ch[i] == ch[i + 1]) {
      build(s[++scnt], ch[i], dp[i + 1]);
      dp[i] = strmin(scnt, dp[i + 2]);
    } else {
      build(s[++scnt], ch[i], dp[i + 1]);
      dp[i] = scnt;
    }
  }
  for (int i = 1; i <= n; ++i) {
    printf("%d ", s[dp[i]].len);
    print(dp[i]);
    puts("");
  }
  return 0;
}
