#include <bits/stdc++.h>
using namespace std;
char ans[100005][15];
int l[100005];
char s[100005];
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  deque<pair<int, int> > dq;
  for (int i = n; i >= 1; i--) {
    if (!dq.empty()) {
      if (s[dq.front().first] == s[i]) {
        int c = dq.front().second;
        dq.push_front(make_pair(i, c));
      } else {
        int c = s[dq.front().first];
        dq.push_front(make_pair(i, c));
      }
    } else {
      dq.push_front(make_pair(i, -1));
    }
    if (dq.size() >= 2) {
      if (dq[0].first + 1 == dq[1].first && s[dq[0].first] == s[dq[1].first] &&
          dq[1].second < s[dq[1].first]) {
        dq.pop_front();
        dq.pop_front();
      }
    }
    l[i] = dq.size();
    if (dq.size() <= 10) {
      for (int j = 0; j < dq.size(); j++) ans[i][j] = s[dq[j].first];
    } else {
      ans[i][0] = s[dq[0].first];
      ans[i][1] = s[dq[1].first];
      ans[i][2] = s[dq[2].first];
      ans[i][3] = s[dq[3].first];
      ans[i][4] = s[dq[4].first];
      ans[i][5] = s[dq[dq.size() - 2].first];
      ans[i][6] = s[dq[dq.size() - 1].first];
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%d ", l[i]);
    if (l[i] <= 10) {
      for (int j = 0; j < l[i]; j++) printf("%c", ans[i][j]);
    } else {
      printf("%c%c%c%c%c", ans[i][0], ans[i][1], ans[i][2], ans[i][3],
             ans[i][4]);
      printf("...");
      printf("%c%c", ans[i][5], ans[i][6]);
    }
    printf("\n");
  }
}
