#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void ckmax(T& x, T y) {
  x = (y > x ? y : x);
}
template <typename T>
inline void ckmin(T& x, T y) {
  x = (y < x ? y : x);
}
namespace Fread {
const int SIZE = 1 << 21;
char buf[SIZE], *S, *T;
inline char getchar() {
  if (S == T) {
    T = (S = buf) + fread(buf, 1, SIZE, stdin);
    if (S == T) return EOF;
  }
  return *S++;
}
}  // namespace Fread
namespace Fwrite {
const int SIZE = 1 << 21;
char buf[SIZE], *S = buf, *T = buf + SIZE;
inline void flush() {
  fwrite(buf, 1, S - buf, stdout);
  S = buf;
}
inline void putchar(char c) {
  *S++ = c;
  if (S == T) flush();
}
struct NTR {
  ~NTR() { flush(); }
} ztr;
}  // namespace Fwrite
namespace Fastio {
struct Reader {
  template <typename T>
  Reader& operator>>(T& x) {
    char c = Fread ::getchar();
    T f = 1;
    while (c < '0' || c > '9') {
      if (c == '-') f = -1;
      c = Fread ::getchar();
    }
    x = 0;
    while (c >= '0' && c <= '9') {
      x = x * 10 + (c - '0');
      c = Fread ::getchar();
    }
    x *= f;
    return *this;
  }
  Reader& operator>>(char& c) {
    c = Fread ::getchar();
    while (c == '\n' || c == ' ') c = Fread ::getchar();
    return *this;
  }
  Reader& operator>>(char* str) {
    int len = 0;
    char c = Fread ::getchar();
    while (c == '\n' || c == ' ') c = Fread ::getchar();
    while (c != '\n' && c != ' ') {
      str[len++] = c;
      c = Fread ::getchar();
    }
    str[len] = '\0';
    return *this;
  }
  Reader() {}
} cin;
const char endl = '\n';
struct Writer {
  template <typename T>
  Writer& operator<<(T x) {
    if (x == 0) {
      Fwrite ::putchar('0');
      return *this;
    }
    if (x < 0) {
      Fwrite ::putchar('-');
      x = -x;
    }
    static int sta[45];
    int top = 0;
    while (x) {
      sta[++top] = x % 10;
      x /= 10;
    }
    while (top) {
      Fwrite ::putchar(sta[top] + '0');
      --top;
    }
    return *this;
  }
  Writer& operator<<(char c) {
    Fwrite ::putchar(c);
    return *this;
  }
  Writer& operator<<(char* str) {
    int cur = 0;
    while (str[cur]) Fwrite ::putchar(str[cur++]);
    return *this;
  }
  Writer& operator<<(const char* str) {
    int cur = 0;
    while (str[cur]) Fwrite ::putchar(str[cur++]);
    return *this;
  }
  Writer() {}
} cout;
}  // namespace Fastio
const int MAXN = 1e5;
int n, del[MAXN + 5], nxt[MAXN + 5], pre[MAXN + 5], _nxtc[26];
char s[MAXN + 5];
vector<pair<int, int> > vec;
vector<int> sum;
inline int candel(int len) { return len - (len & 1); }
void print(int p, int len) {
  for (int i = 1; i <= len; ++i) {
    Fastio ::cout << s[p];
    p = nxt[p];
  }
}
void print_rev(int p, int len) {
  vector<int> v;
  for (int i = 1; i <= len; ++i) {
    v.push_back(p);
    p = pre[p];
  }
  for (int i = ((int)(v).size()) - 1; i >= 0; --i) Fastio ::cout << s[v[i]];
}
int main() {
  Fastio ::cin >> (s + 1);
  n = strlen(s + 1);
  int _nxt = n + 1;
  for (int c = 0; c < 26; ++c) _nxtc[c] = n + 1;
  for (int i = n; i >= 1; --i) {
    int j = i;
    while (j - 1 >= 1 && s[j - 1] == s[i]) --j;
    int p = n + 1;
    for (int c = 0; c < 26; ++c)
      if (c != s[i] - 'a') ckmin(p, _nxtc[c]);
    if (j < i && s[i] > s[p]) {
      vec.push_back(make_pair(j, i));
      for (int k = j; k <= i - ((i - j + 1) & 1); ++k) del[k] = 1;
    }
    for (int k = i; k >= j; --k) {
      nxt[k] = _nxt;
      if (!del[k]) {
        _nxt = k;
        _nxtc[s[k] - 'a'] = k;
      }
    }
    i = j;
  }
  int _pre = 0;
  for (int i = 1; i <= n + 1; ++i) {
    pre[i] = _pre;
    if (i != n + 1 && !del[i]) _pre = i;
  }
  reverse(vec.begin(), vec.end());
  sum.resize(((int)(vec).size()) + 1);
  for (int i = ((int)(vec).size()) - 1; i >= 0; --i)
    sum[i] = sum[i + 1] + candel(vec[i].second - vec[i].first + 1);
  int j = 0;
  for (int i = 1; i <= n; ++i) {
    while (j < ((int)(vec).size()) && vec[j].second < i) ++j;
    if (j == ((int)(vec).size())) {
      Fastio ::cout << n - i + 1 << " ";
      if (n - i + 1 <= 10) {
        for (int k = i; k <= n; ++k) Fastio ::cout << s[k];
      } else {
        for (int k = i; k <= i + 4; ++k) Fastio ::cout << s[k];
        Fastio ::cout << "...";
        Fastio ::cout << s[n - 1] << s[n];
      }
      Fastio ::cout << Fastio ::endl;
    } else if (vec[j].first > i) {
      int len = n - i + 1 - sum[j];
      Fastio ::cout << len << " ";
      if (len <= 10) {
        print(i, len);
      } else {
        print(i, 5);
        Fastio ::cout << "...";
        print_rev(pre[n + 1], 2);
      }
      Fastio ::cout << Fastio ::endl;
    } else {
      int len = n - i + 1 - sum[j + 1] - candel(vec[j].second - i + 1);
      Fastio ::cout << len << " ";
      if (len <= 10) {
        print(
            ((vec[j].second - i + 1) & 1) ? vec[j].second : nxt[vec[j].second],
            len);
      } else {
        print(
            ((vec[j].second - i + 1) & 1) ? vec[j].second : nxt[vec[j].second],
            5);
        Fastio ::cout << "...";
        print_rev(pre[n + 1], 2);
      }
      Fastio ::cout << Fastio ::endl;
    }
  }
  return 0;
}
