#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const int Bases = 2;
const long long base[] = {137, 37};
const long long mod = 1000000007LL;
long long addi(long long a, long long b, long long m = mod) {
  a += b;
  if (a < 0) a += m;
  if (a >= m) a -= m;
  return a;
}
long long subt(long long a, long long b, long long m = mod) {
  a -= b;
  if (a < 0) a += m;
  if (a >= m) a -= m;
  return a;
}
long long mult(long long a, long long b, long long m = mod) {
  return a * b % m;
}
long long power(long long a, long long b, long long m = mod) {
  long long tmp = 1;
  for (; b > 0; b >>= 1) {
    if (b & 1LL) tmp = mult(tmp, a, m);
    a = mult(a, a, m);
  }
  return tmp;
}
long long inv(long long a, long long m = mod) { return power(a, m - 2, m); }
long long POW[N][Bases];
pair<int, string> RES[N];
string s, t;
int cnt = 0;
bool deleted;
struct Hash {
  long long a[2];
  Hash operator+(const Hash& src) {
    Hash tmp;
    for (int i = 0; i < Bases; ++i) tmp.a[i] = addi(a[i], src.a[i]);
    return tmp;
  }
  Hash operator-(const Hash& src) {
    Hash tmp;
    for (int i = 0; i < Bases; ++i) tmp.a[i] = subt(a[i], src.a[i]);
    return tmp;
  }
  Hash operator*(int x) {
    Hash tmp;
    for (int i = 0; i < Bases; ++i) tmp.a[i] = mult(a[i], POW[x][i]);
    return tmp;
  }
  Hash operator+(char c) {
    Hash tmp;
    for (int i = 0; i < Bases; ++i)
      tmp.a[i] = addi(mult(a[i], base[i]), c - 'a');
    return tmp;
  }
  bool operator==(const Hash& src) {
    for (int i = 0; i < Bases; ++i)
      if (a[i] != src.a[i]) return false;
    return true;
  }
};
Hash hashes[N];
Hash getHash(int l, int r) { return hashes[r] - hashes[l - 1] * (r - l + 1); }
void del() {
  cnt -= 2;
  t.pop_back();
  t.pop_back();
  deleted = true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  POW[0][0] = POW[0][1] = 1;
  for (int i = 1; i <= 100000; ++i) {
    for (int j = 0; j < Bases; ++j) POW[i][j] = mult(POW[i - 1][j], base[j]);
  }
  reverse(s.begin(), s.end());
  int n = s.length();
  s = ' ' + s;
  deleted = false;
  for (int i = 1; i <= n; ++i) {
    t += s[i];
    ++cnt;
    hashes[cnt] = hashes[cnt - 1] + s[i];
    if (t.length() > 1 && t.back() == t[t.length() - 2] && !deleted) {
      int r1 = t.length(), r2 = t.length() - 2;
      int l = 1, r = cnt - 2, res = 0;
      while (l <= r) {
        int mid = (l + r) >> 1;
        if (getHash(r1 - mid + 1, r1) == getHash(r2 - mid + 1, r2))
          l = mid + 1;
        else {
          r = mid - 1;
          res = mid;
        }
      }
      if (res == 0)
        del();
      else {
        r1 = r1 - res;
        r2 = r2 - res;
        if (t[r2] < t[r1]) del();
      }
    } else
      deleted = false;
    RES[i].first = t.length();
    if (t.length() > 10)
      RES[i].second = t.substr(0, 2) + "..." + t.substr(t.length() - 5, 5);
    else
      RES[i].second = t;
  }
  for (int i = n; i > 0; --i) {
    reverse(RES[i].second.begin(), RES[i].second.end());
    cout << RES[i].first << ' ' << RES[i].second << '\n';
  }
  return 0;
}
