#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
template <class T1, class T2>
struct cmpf {
  bool rev;
  inline bool operator()(const pair<T1, T2>& a, const pair<T1, T2>& b) const {
    return (a.first < b.first) ^ rev;
  }
  cmpf(bool b = false) { rev = b; }
};
template <class T1, class T2>
struct cmps {
  bool rev;
  inline bool operator()(const pair<T1, T2>& a, const pair<T1, T2>& b) const {
    return (a.second < b.second) ^ rev;
  }
  cmps(bool b = false) { rev = b; }
};
long long binpow(long long x, long long p, const long long& mod) {
  assert(mod > 0);
  long long ret = 1;
  for (; p > 0; p >>= 1, x = x * x % mod)
    if (p & 1) ret = ret * x % mod;
  return ret;
}
template <class T>
void chmn(T& a, const T& b) {
  if (a > b) a = b;
}
template <class T>
void chmx(T& a, const T& b) {
  if (a < b) a = b;
}
void setIO(const string& filename = "") {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
}
int chr[8] = {-1, 0, 1, 0, -1, -1, 1, 1};
int chc[8] = {0, 1, 0, -1, -1, 1, -1, 1};
const long long MOD = 1e9 + 7;
const int INIT = 1001001001;
const int MN = 1001001;
const int ML = 15;
bool cmp(const pair<string, string>& a, const pair<string, string>& b) {
  for (int i = 0; i < a.first.size() && i < b.first.size(); ++i) {
    if (a.first[i] != b.first[i]) {
      return a.first[i] < b.first[i];
    }
  }
  return (a.second.size() > 0 && b.second.size() > 0);
}
long long N, M, K;
long long len[MN];
pair<string, string> ans[MN];
void solve(int testcase) {
  string s;
  cin >> s;
  N = s.size();
  if (N == 1) {
    cout << "1 " << s << endl;
    return;
  }
  string ending = s.substr(N - 2, 2);
  ans[0] = pair<string, string>("", "");
  ans[1] = pair<string, string>(string(1, (char)s.back()), "");
  len[1] = 1;
  for (int i = 2; i <= N; ++i) {
    int idx = N - i;
    ans[i] = pair<string, string>(s[idx] + ans[i - 1].first, ans[i - 1].second);
    (ans[i]);
    len[i] = len[i - 1] + 1;
    if (s[idx] == s[idx + 1]) {
      if (!cmp(ans[i], ans[i - 2])) {
        ans[i] = ans[i - 2];
        len[i] = len[i - 2];
      }
    }
    if (ans[i].first.size() > ML) {
      if (ans[i].second.empty()) {
        ans[i].second = ans[i].first.substr(ans[i].first.size() - 2, 2);
      }
      while (ans[i].first.size() > ML) {
        ans[i].first.pop_back();
      }
    }
  }
  for (int i = N; i > 0; --i) {
    cout << len[i] << ' ';
    if (len[i] > 10) {
      string last = ans[i].second;
      if (last.empty()) {
        last = ans[i].first.substr(ans[i].first.size() - 2, 2);
      }
      cout << ans[i].first.substr(0, 5) << "..." << last << '\n';
    } else {
      cout << ans[i].first << '\n';
    }
  }
}
int main() {
  setIO();
  long long T = 1;
  for (int t = 1; t <= T; t++) solve(t);
  return 0;
}
