Problem: Alice bought a Congo Prime Video subscription and was watching a documentary on the archaeological findings from Factor's Island on Loch Katrine in Scotland. The archaeologists found a book whose age and origin are unknown. Perhaps Alice can make some sense of it?

The book contains a single string of characters "a", "b" and "c". It has been pointed out that no two consecutive characters are the same. It has also been conjectured that the string contains an unusually long subsequence that reads the same from both sides. 

Help Alice verify this by finding such subsequence that contains at least half of the characters of the original string, rounded down. Note that you don't have to maximise the length of it.

A string a is a subsequence of a string b if a can be obtained from b by deletion of several (possibly, zero or all) characters.

Input

The input consists of a single string s (2 ≤ |s| ≤ 10^6). The string s consists only of characters "a", "b", "c". It is guaranteed that no two consecutive characters are equal.

Output

Output a palindrome t that is a subsequence of s and |t| ≥ ⌊ (|s|)/(2) ⌋.

If there are multiple solutions, you may print any of them. You don't have to maximise the length of t.

If there are no solutions, output a string "IMPOSSIBLE" (quotes for clarity).

Examples

Input


cacbac


Output


aba


Input


abc


Output


a


Input


cbacacacbcbababacbcb


Output


cbaaacbcaaabc

Note

In the first example, other valid answers include "cacac", "caac", "aca" and "ccc". 

Solution (in PYTHON3):

Solution:





sre               =                input()
























pre                     =                             0














kre                    =                 len(sre)         -           1

























pointeree                         =                                          0














plotttt                   =                    []
















while (pre        +        1            <          kre         -      1): 
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	if( sre[  pre ]               ==        sre[  kre ]):
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		plotttt.append( sre[ pre ])
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		pre                           +=                   1
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		kre                                -=                            1
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		pointeree                                                     +=                      2
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	elif (sre[  pre ]                        ==              sre[  kre     -   1]):
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		plotttt.append(  sre[  pre  ])
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		pre                                +=                         1
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		kre                              -=                               2
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	elif( sre[  pre   +          1]                     ==                  sre[        kre    ]):
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		plotttt.append(  sre[ pre   +  1 ])
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		pre                           +=                                 2
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		kre                     -=                  1
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	else:
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
		plotttt.append( sre[    pre       +          1 ])
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		pre                             +=                             2
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		kre                                               -=                     2

























dfdkngkfgjfb                                      =             0




















if (kre          -          pre            ==            2):
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	xrere           =                [  sre[  pre  ],        sre[   pre  +    1],          sre[      pre  +    2 ]]


















	
	
	
	
	
	
	
	xrere.sort()
	
	
	
	
	
	
	
	
	
	
	
	
	
	if( xrere[0]                              ==          xrere[1]):
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		plotttt.append( xrere[ 0 ])
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	elif (xrere[ 1 ]                  ==                xrere[ 2 ]):
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		plotttt.append( xrere[ 1 ])
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	else:
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
		dfdkngkfgjfb                        =                  xrere[ 1 ]

























if(      kre            -            pre           ==       1):
	
	
	
	
	
	
	
	
	
	
	
	
	if( sre[ pre]                     ==             sre[  pre        +     1 ]):


















		plotttt.append( sre[ pre ])
























	else:



















		dfdkngkfgjfb                          =             sre[  pre  ]



















if (kre               ==                            pre):























	dfdkngkfgjfb                              =                            sre[  pre  ]






















if(                    dfdkngkfgjfb               ==            0):
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	if (          len(   plotttt)   *    2                  >=                 len( sre )//2):
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		for i in plotttt:
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
			print(i, end = "")
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		for i in range(len(plotttt)):
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
			j                                    =           len(    plotttt    )         -         1        -   i
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			print(plotttt[j], end = "")
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	else:
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		print("IMPOSSIBLE")


























else:
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	if (         2             *       len(         plotttt        )        +       1)           >=            len(  sre   )//2:
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		for i in plotttt:
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			print(i,             end = "")
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		print(         dfdkngkfgjfb,                        end = "")
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		for i in range(len(      plotttt   )):
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			j                       =              len(        plotttt          )            -              1             - i
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
			print(             plotttt[ j ],                  end = "")
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	else:
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
		
		
		
		
		
		
		
		
		
		
		
		
		
		print("IMPOSSIBLE")