Some time ago Lesha found an entertaining string s consisting of lowercase English letters. Lesha immediately developed an unique algorithm for this string and shared it with you. The algorithm is as follows.

Lesha chooses an arbitrary (possibly zero) number of pairs on positions (i, i + 1) in such a way that the following conditions are satisfied: 

  * for each pair (i, i + 1) the inequality 0 ≤ i < |s| - 1 holds; 
  * for each pair (i, i + 1) the equality s_i = s_{i + 1} holds; 
  * there is no index that is contained in more than one pair. 

After that Lesha removes all characters on indexes contained in these pairs and the algorithm is over. 

Lesha is interested in the lexicographically smallest strings he can obtain by applying the algorithm to the suffixes of the given string.

Input

The only line contains the string s (1 ≤ |s| ≤ 10^5) — the initial string consisting of lowercase English letters only.

Output

In |s| lines print the lengths of the answers and the answers themselves, starting with the answer for the longest suffix. The output can be large, so, when some answer is longer than 10 characters, instead print the first 5 characters, then "...", then the last 2 characters of the answer.

Examples

Input


abcdd


Output


3 abc
2 bc
1 c
0 
1 d


Input


abbcdddeaaffdfouurtytwoo


Output


18 abbcd...tw
17 bbcdd...tw
16 bcddd...tw
15 cddde...tw
14 dddea...tw
13 ddeaa...tw
12 deaad...tw
11 eaadf...tw
10 aadfortytw
9 adfortytw
8 dfortytw
9 fdfortytw
8 dfortytw
7 fortytw
6 ortytw
5 rtytw
6 urtytw
5 rtytw
4 tytw
3 ytw
2 tw
1 w
0 
1 o

Note

Consider the first example.

  * The longest suffix is the whole string "abcdd". Choosing one pair (4, 5), Lesha obtains "abc". 
  * The next longest suffix is "bcdd". Choosing one pair (3, 4), we obtain "bc". 
  * The next longest suffix is "cdd". Choosing one pair (2, 3), we obtain "c". 
  * The next longest suffix is "dd". Choosing one pair (1, 2), we obtain "" (an empty string). 
  * The last suffix is the string "d". No pair can be chosen, so the answer is "d". 



In the second example, for the longest suffix "abbcdddeaaffdfouurtytwoo" choose three pairs (11, 12), (16, 17), (23, 24) and we obtain "abbcdddeaadfortytw"
#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  ~debug() { cerr << endl; }
  template <class c>
  typename enable_if<sizeof dud<c>(0) != 1, debug&>::type operator<<(c i) {
    cerr << boolalpha << i;
    return *this;
  }
  template <class c>
  typename enable_if<sizeof dud<c>(0) == 1, debug&>::type operator<<(c i) {
    return *this << range(begin(i), end(i));
  }
  template <class c, class b>
  debug& operator<<(pair<b, c> d) {
    return *this << "(" << d.first << ", " << d.second << ")";
  }
  template <class c>
  debug& operator<<(rge<c> d) {
    *this << "[";
    for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it;
    return *this << "]";
  }
};
long double eps = (long double)1 / 1e6;
const long double pi = 3.14159265359;
long long inf = 1e18, mod1 = 1e9 + 7;
long long sqr(long long a) { return a * a; }
long long qb(long long a) { return a * a * a; }
template <typename T>
bool umax(T& a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T>
bool umin(T& a, T b) {
  return b < a ? a = b, 1 : 0;
}
bool is_prime(long long val) {
  for (long long i = 2; i <= sqrt(val); i++)
    if (val % i == 0) return 0;
  return 1;
}
long long gcd(long long a, long long b) { return !a ? b : gcd(b % a, a); }
long long binpow(long long a, long long b, long long mod) {
  return b ? (b % 2 ? (a * (sqr(binpow(a, b / 2, mod)) % mod)) % mod
                    : sqr(binpow(a, b / 2, mod)) % mod)
           : 1;
}
long long binmult(long long a, long long b, long long mod) {
  return b ? (b % 2 ? (2 * binmult(a, b / 2, mod) + a) % mod
                    : (2 * binmult(a, b / 2, mod)) % mod)
           : 0;
}
const long long RR = 1e4;
const long long tx[8] = {1, -1, 2, -2, -1, -2};
const long long ty[8] = {-2, -2, -1, -1, 2, 1};
const char rev_to[4] = {'E', 'W', 'N', 'S'};
const long long M = 1e9 + 7;
const long long N = 2e5 + 3;
const long long ppp = 73;
const long long K = 2e5 + 2;
const long long block = 600;
const long long OPEN = 1;
const long long CLOSE = 0;
auto rnd =
    bind(uniform_int_distribution<long long>(1, 5969699), mt19937(time(0)));
void bad() {
  cout << "IMPOSSIBLE";
  exit(0);
}
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  ;
  string second;
  cin >> second;
  long long n = (long long)second.size();
  vector<string> ans(n);
  vector<long long> a1(n);
  vector<pair<char, pair<long long, long long>>> w;
  string otv;
  for (long long i = n - 1; i >= 0; i--) {
    if (!(long long)w.size()) {
      w.push_back({second[i], {1, 1}});
      otv += second[i];
    } else {
      if (second[i] == w.back().first) {
        if (w.back().second.second == 1 && w.back().second.first) {
          otv.pop_back();
          w.pop_back();
          if ((long long)w.size()) {
            w.back().second.second = (w.back().second.second == 2 ? 2 : 0);
          }
        } else if (w.back().second.second != 1) {
          w.push_back({second[i], {1, (w.back().second.second == 2 ? 2 : 1)}});
          otv += second[i];
        } else {
          w.back().second.first ^= 1;
          otv += second[i];
        }
      } else {
        if (w.back().first > second[i]) {
          w.push_back({second[i], {1, 2}});
        } else {
          w.push_back({second[i], {1, 1}});
        }
        otv += second[i];
      }
    }
    long long dl = (long long)otv.size();
    a1[i] = dl;
    if (dl > 10) {
      string first = otv.substr(dl - 5, 5), second = otv.substr(0, 2);
      reverse(first.begin(), first.end());
      reverse(second.begin(), second.end());
      ans[i] = first + "..." + second;
    } else
      ans[i] = otv, reverse(ans[i].begin(), ans[i].end());
  }
  for (long long i = 0; i < n; i++) {
    cout << a1[i] << ' ' << ans[i] << "\n";
  }
  return 0;
}
