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 JAVA):

Solution:
import java.util.*;
import java.io.*;
public class E{

	static long fast_pow(long base,long n,long M)
    {
        if(n==0)
           return 1;
        if(n==1)
        return base;
        long halfn=fast_pow(base,n/2,M);
        if(n%2==0)
            return (halfn*halfn)%M;
        else
            return (((halfn*halfn)%M)*base)%M;
    }

	public static void main(String args[]){
		// Reader sc=new Reader(); 
        Scanner sc=new Scanner(System.in);
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        // int n=sc.nextInt();
        int i=0,j=0,k=0,l=0;
        int a[]=new int[1000000];
        int b[]=new int[1000000];
        int c[]=new int[1000000];
        String s=sc.next();
        int n=s.length();
        char ch;
        for(i=0;i<s.length();i++){
        	ch=s.charAt(i);
        	if(ch=='a')
        		a[j++]=i;
        	else if(ch=='b')
        		b[k++]=i;
        	else
        		c[l++]=i;
        }
        int i1=0,i2=j-1,j1=0,j2=k-1,k1=0,k2=l-1;
        int sum=0,f,flag=0,ya,yb,yc;
        ya=i2-i1;yb=j2-j1;yc=k2-k1;
        StringBuilder ff=new StringBuilder("");
        // String bb="";
        while(sum<n/2){
        	ya=i2-i1;yb=j2-j1;yc=k2-k1;
        	// System.out.println(ff+bb);
        	// System.out.println(ya+" "+yb+" "+yc);
        	if(ya<=0&&yb<=0&&yc<=0){
        		flag=1;
        		break;
        	}
        	if(i2>=0)
        		ya=a[i2]-a[i1];
        	if(j2>=0)
        		yb=b[j2]-b[j1];
        	if(k2>=0)
        		yc=c[k2]-c[k1];
        	if(ya>=yb&&ya>=yc){
        		sum+=2;
        		f=a[i1];
        		l=a[i2];
        		i2--;
        		i1++;
        		ff.append("a");
        		// bb='a'+bb;
        		for(;j1<j2&&b[j1]<f;j1++);
        		for(;j2>j1&&b[j2]>l;j2--);
        		for(;k1<k2&&c[k1]<f;k1++);
        		for(;k2>k1&&c[k2]>l;k2--);
        	}
        	else if(yb>=ya&yb>=yc){
        		sum+=2;
        		f=b[j1];
        		l=b[j2];
        		j2--;
        		j1++;
        		ff.append("b");
        		// bb='b'+bb;
        		for(;i1<i2&&a[i1]<f;i1++);
        		for(;i2>i1&&a[i2]>l;i2--);
        		for(;k1<k2&&c[k1]<f;k1++);
        		for(;k2>k1&&c[k2]>l;k2--);
        	}
        	else{
        		sum+=2;
        		f=c[k1];
        		l=c[k2];
        		k2--;
        		k1++;
        		ff.append("c");
        		// bb='c'+bb;
        		for(;i1<i2&&a[i1]<f;i1++);
        		for(;i2>i1&&a[i2]>l;i2--);
        		for(;j1<j2&&b[j1]<f;j1++);
        		for(;j2>j1&&b[j2]>l;j2--);
        	}
        }
        StringBuilder bb=ff;
        String h=ff.toString();
        bb.reverse();
        if(flag==0){
        	pw.println(h+bb.toString());
        }
        else if(sum+1==n/2){
        	if(ya==0){
        		pw.println(h+"a"+bb.toString());
        	}
        	else if(yb==0){
        		pw.println(h+"b"+bb.toString());
        	}
        	else if(yc==0){
        		pw.println(h+"c"+bb.toString());
        	}
        	else 
        		pw.println("IMPOSSIBLE");
        }
        else 
        	pw.println("IMPOSSIBLE");
        pw.close();
	}
}