#include <bits/stdc++.h>
using namespace std;
string s;
deque<pair<pair<char, char>, int>> q;
vector<pair<int, string>> ans;
void solve() {
  string cur = "";
  if (q.size() <= 10) {
    int n = q.size();
    while (n--) {
      cur += q.front().first.first;
      q.push_back(q.front());
      q.pop_front();
    }
    ans.push_back({q.size(), cur});
    return;
  }
  vector<pair<pair<char, char>, int>> v;
  for (int i = 0; i < 5; i++) {
    cur += q.front().first.first;
    v.push_back(q.front());
    q.pop_front();
  }
  while (!v.empty()) q.push_front(v.back()), v.pop_back();
  cur += "...";
  pair<pair<char, char>, int> x = q.back();
  q.pop_back();
  cur += q.back().first.first;
  cur += x.first.first, q.push_back(x);
  ans.push_back({q.size(), cur});
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  reverse(s.begin(), s.end());
  for (int i = 0; i < s.size(); i++) {
    pair<pair<char, char>, int> cur;
    if (q.empty())
      cur = {{s[i], '*'}, i};
    else if (s[i] != q.front().first.first)
      cur = {{s[i], q.front().first.first}, i};
    else
      cur = {{s[i], q.front().first.second}, i};
    if (q.empty() || s[i] != q.front().first.first ||
        q.front().second + 1 != i) {
      q.push_front(cur);
      solve();
      continue;
    }
    pair<pair<char, char>, int> x = q.front();
    q.pop_front();
    if (!q.empty() && q.front().first > x.first) {
      q.push_front(x);
      q.push_front(cur);
    } else if (!q.empty() && q.front().first.first == x.first.first &&
               q.front().first.second > s[i]) {
      q.push_front(x);
      q.push_front(cur);
    }
    solve();
  }
  reverse(ans.begin(), ans.end());
  for (auto i : ans) cout << i.first << " " << i.second << "\n";
}
