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"
/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
What do you think? What do you think?
1st on Billboard, what do you think of it
Next is a Grammy, what do you think of it
However you think, I’m sorry, but shit, I have no fcking interest
*******************************
I'm standing on top of my Monopoly board
That means I'm on top of my game and it don't stop
til my hip don't hop anymore
https://www.a2oj.com/Ladder16.html
*******************************
Shining through the city with a little funk and soul
*******************************
300iq as writer = Sad!
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class x1422E
   {
      public static void main(String hi[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
         String input = infile.readLine();
         int N = input.length();
         char[] arr = input.toCharArray();
         int[] length = new int[N];
         String[] res = new String[N];
         ArrayDeque<Unit> deque = new ArrayDeque<Unit>();
         Stack<Unit> stack = new Stack<Unit>();
         for(int i=N-1; i >= 0; i--)
         {
            if(deque.size() == 0)
               deque.addFirst(new Unit(arr[i], i));
            else if(arr[i] != deque.peekFirst().letter)
            {
               stack.push(new Unit(deque.peekFirst().letter, -1));
               deque.addFirst(new Unit(arr[i], i));
            }
            else
            {
               if(i+1 == deque.peekFirst().pos)
               {
                  while(stack.size() > 0 && stack.peek().letter == arr[i])
                     stack.pop();
                  if(stack.size() == 0)
                     deque.pollFirst();
                  else if(arr[i] >= stack.peek().letter)
                  {
                     char omkar = stack.peek().letter;
                     deque.pollFirst();
                     //stack.pop();
                  }
                  else
                     deque.addFirst(new Unit(arr[i], i));
               }
               else
                  deque.addFirst(new Unit(arr[i], i));
            }
            length[i] = deque.size();
            res[i] = gen(deque);
         }
         StringBuilder sb = new StringBuilder();
         for(int a=0; a < N; a++)
            sb.append(length[a]+" ").append(res[a]+"\n");
         System.out.print(sb);
      }
      public static String gen(ArrayDeque<Unit> deque)
      {
         if(deque.size() <= 10)
         {
            String res = "";
            int size = deque.size();
            for(int i=0; i < size; i++)
            {
               Unit lol = deque.pollFirst();
               res += lol.letter;
               deque.addLast(lol);
            }
            return res;
         }
         else
         {
            Unit[] head = new Unit[5];
            Unit[] tail = new Unit[2];
            String res = "";
            for(int i=0; i < 5; i++)
               head[i] = deque.pollFirst();
            for(int i=1; i >= 0; i--)
               tail[i] = deque.pollLast();
            for(Unit c: head)
               res += c.letter;
            res += "...";
            for(Unit c: tail)
               res += c.letter;
            for(int i=4; i >= 0; i--)
               deque.addFirst(head[i]);
            for(int i=0; i < 2; i++)
               deque.addLast(tail[i]);
            return res;
         }
      }
   }
   class Unit
   {
      public char letter;
      public int pos;
      
      public Unit(char c, int a)
      {
         letter = c;
         pos = a;
      }
   }