#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7, INF = 0x3f3f3f3f;
const long long LNF = 0x3f3f3f3f3f3f3f3f;
char st[N];
int sta[N], sflag[N];
int main() {
  srand(time(0));
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  vector<string> ans;
  vector<int> ansv;
  int top = -1;
  for (int i = s.length() - 1; i >= 0; --i) {
    st[++top] = s[i];
    sta[top] = i;
    if (top >= 1 && st[top] == st[top - 1]) {
      int flag = 1;
      if (top >= 2 && st[top] == st[top - 2]) {
        flag = sflag[top - 1];
      } else {
        for (int j = 0; j < 2 && top - 2 - j >= 0; ++j) {
          if (st[top - j] == st[top - 2 - j]) {
            continue;
          } else if (st[top - j] < st[top - 2 - j]) {
            flag = 0;
            break;
          } else {
            break;
          }
        }
      }
      sflag[top] = flag;
      if (sta[top] + 1 == sta[top - 1] && flag) {
        top -= 2;
      }
    }
    string temp;
    if (top > 9) {
      for (int i = 0; i < 5; ++i) {
        temp += st[top - i];
      }
      temp += "...";
      temp += st[1];
      temp += st[0];
    } else {
      for (int i = top; i >= 0; --i) {
        temp += st[i];
      }
    }
    ans.push_back(temp);
    ansv.push_back(top + 1);
  }
  for (int i = ans.size() - 1; i >= 0; --i) {
    cout << ansv[i] << " " << ans[i] << endl;
  }
}
