using System;
using System.Collections;
using System.Collections.Generic;

class Program
{
 static void Main( string[] args )
 {
   int[] num = new int[3];
   int loopNum = 0;
   int cnt =0;
   int removeBlock = 0;
   var blockList = new List<char>();
   
   String str = Console.ReadLine();
   char[] chArray = str.ToCharArray();
   
   blockList.AddRange(chArray);
   
   while(blockList.Count > cnt+1)
   {
     if( blockList[cnt] != blockList[cnt+1] )
     {
       removeBlock += 2;

       if( blockList.Count != 2 )
       {
         blockList.RemoveAt(cnt);           
         blockList.RemoveAt((cnt));
       }
       else
       {
         break;
       }

       cnt = 0;
     }
     else
     {
       cnt++;
     }
     
     Console.WriteLine(cnt);
     foreach( char c in blockList )
     {
       Console.Write(c);
     }
     Console.WriteLine();
   }

   Console.WriteLine(removeBlock);
 }
}

