9 5 14
7 1 4 8 5 2 6 9 3
2 8
1 6
5 7
1 3
3 9
1 5
1 8
1 5
1 4
1 8
1 3
1 5
1 5
1 7
1 7
2 3
1 2
1 1
1 2
 6 5 8
1 2 6 3 4 5
2 4
1 3
1 6
3 5
2 5
1 1
1 4
1 1
2 1
2 5
2 2
2 3
1 4
 2 1 3
1 2
1 2
1 1
1 1
1 1

6
9
5
8
1
7
0
0
0
0
0
4
0
 6
5
4
3
 2
1
0

#include <bits/stdc++.h>
using namespace std;
string str;
int N;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> str;
  N = str.size();
  auto ch = vector<char>(N + 1, '`');
  auto dp = vector<int>(N + 1, N + 1);
  auto ans = vector<string>(N + 1, "");
  dp[N] = 0;
  for (int i = N - 1; i >= 0; i--) {
    bool flag = false;
    if (i < N - 1 && str[i] == str[i + 1]) {
      if (dp[i + 1] == 0 || (ans[i + 2][0] == str[i] && ch[i + 2] < str[i]) ||
          (ans[i + 2][0] < str[i])) {
        dp[i] = dp[i + 2];
        ans[i] = ans[i + 2];
        ch[i] = ch[i + 2];
        flag = true;
      }
    }
    if (!flag) {
      dp[i] = 1 + dp[i + 1];
      ans[i] += str[i];
      if (dp[i] > 10) {
        for (int j = 0; j < 4; j++) ans[i] += ans[i + 1][j];
        for (int j = 0; j < 3; j++) ans[i] += '.';
        for (int j = 8; j < 10; j++) ans[i] += ans[i + 1][j];
      } else
        ans[i] += ans[i + 1];
      if (i == N - 1 || ans[i + 1][0] == str[i])
        ch[i] = ch[i + 1];
      else
        ch[i] = ans[i + 1][0];
    }
  }
  for (int i = int(0); i < int(N); i++) {
    cout << dp[i] << " " << ans[i] << "\n";
  }
  return 0;
}
