#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
const long long Mod = 998244353;
const long long INF = 1e9 + 1;
const double EPS = 1e-9;
pair<int, string> add(char c, pair<int, string> p) {
  if (p.first == 0) return p.first = 1, p.second = c, p;
  p.second = c + p.second;
  p.first++;
  if (p.second.size() <= 10) return p;
  for (int i = 5; i < 8; i++) p.second[i] = '.';
  p.second[8] = p.second[9];
  p.second[9] = p.second[10];
  p.second.pop_back();
  return p;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  vector<pair<int, string>> ans(n + 1);
  int b = 0;
  while ((1 << b) <= n + 1) b++;
  vector<vector<long long>> H(n + 1, vector<long long>(b));
  vector<vector<long long>> par(n + 1, vector<long long>(b));
  par[n] = vector<long long>(b, n);
  vector<long long> Pow(1 << b);
  long long Seed = 37;
  Pow[0] = 1;
  Pow[1] = Seed;
  for (int i = 2; i < (1 << b); i++) Pow[i] = Pow[i - 1] * Seed % Mod;
  s += char('a' - 1);
  for (int i = n - 1; i >= 0; i--) {
    ans[i] = add(s[i], ans[i + 1]);
    H[i][0] = (s[i] - 'a' + 1) * Pow[1] % Mod;
    par[i][0] = i + 1;
    for (int j = 1; j < b; j++) {
      int k = par[i][j - 1];
      par[i][j] = par[k][j - 1];
      H[i][j] = (H[i][j - 1] + H[k][j - 1] * Pow[1 << j - 1]) % Mod;
    }
    if (i == n - 1 || s[i] != s[i + 1]) continue;
    int p1 = i, p2 = i + 2;
    for (int j = b - 1; j >= 0; j--)
      if (H[p1][j] == H[p2][j]) p1 = par[p1][j], p2 = par[p2][j];
    if (ans[p1].second > ans[p2].second) {
      par[i] = par[i + 2];
      H[i] = H[i + 2];
      ans[i] = ans[i + 2];
    }
  }
  for (int i = 0; i < n; i++)
    cout << ans[i].first << ' ' << ans[i].second << '\n';
  return 0;
}
