#include <bits/stdc++.h>
using namespace std;
const int MAX = (2e5) + 10;
int n, sz[MAX];
string str, res[MAX];
pair<char, int> stk[MAX];
int top = -1;
void insertChar(char c, int i) {
  stk[++top] = {c, i};
  if (top >= 1 && stk[top].first == stk[top - 1].first &&
      stk[top].second + 1 == stk[top - 1].second) {
    int era = true;
    for (int p = top - 2; p >= 0; p--) {
      if (abs(p - top) > 10) {
        era = false;
        break;
      }
      if (stk[top].first == stk[p].first) {
        continue;
      }
      era = (stk[top].first > stk[p].first);
      break;
    }
    if (era) {
      top -= 2;
    }
  }
}
string getAns() {
  string ret = "";
  if (top > 9) {
    for (int i = 0; i <= 1; i++) {
      ret = stk[i].first + ret;
    }
    ret = "..." + ret;
    string kil = "";
    for (int i = 0; i <= 4; i++) {
      kil = kil + stk[top - i].first;
    }
    ret = kil + ret;
  } else {
    for (int i = 0; i <= top; i++) {
      ret = ret + stk[top - i].first;
    }
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> str;
  n = str.size();
  for (int i = n - 1; i >= 0; i--) {
    insertChar(str[i], i);
    sz[i] = top + 1;
    res[i] = getAns();
  }
  for (int i = 0; i <= n - 1; i++) {
    cout << sz[i] << " " << res[i] << endl;
  }
  return 0;
}
