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.math.*;

// **** E. Archaeology ****

public class E {
	static char [] in = new char [1000001];
	public static void main (String [] arg) throws Throwable {
		char [] s = next().toCharArray();
		int [] freq = new int [256];
		for (int i =0;i <s.length;++i) freq[s[i]]++;
		char pivot = 'a';
		if (freq['b'] > freq['a']) pivot = 'b';
		if (freq['c'] > freq['b'] && freq['c'] > freq['a']) pivot = 'c';
		
		//System.err.println("Pivot is " + pivot);
		
		int L = 0;
		int R = s.length-1;
		StringBuilder ans = new StringBuilder(s.length);
		StringBuilder ansR= new StringBuilder(s.length);
		
		while (L <= R) {
			int pL = L;
			int pR = R;
			
		
			while (L <s.length && s[L] != pivot) ++L;
			while (R >= 0 && s[R] != pivot) --R;
			//System.err.println("AT " + L + " , " +R);
			
			int distR = pR - R;
			int distL = L - pL;
			while (distR > 0 && distL > 0 && distR + R >= L - distL) {
				if ( s[distR + R] != s[L - distL]) {
					if (distR > distL) distR--;
					else distL--;
				}
				if (distR <= 0 || distL <= 0) break;
				
				if (distR + R == L - distL) {
					ans = ans.append(s[L-distL]);
					break;
				}
				
				ans = ans.append(s[L-distL]);
				ansR = ansR.append(s[distR + R]);
				distR--;
				distL--;
			}
			
			if (R >= L) ans = ans.append(pivot);
			if (R > L) ansR = ansR.append(pivot);	
			R--;
			L++;
		}
		ans = ans.append(ansR.reverse());
		System.out.println((ans.length() < s.length/2)  ? "IMPOSSIBLE" : ans);
	}

	
	
	
	
	
	
	
	
	
	
	
	
	
	/************** HELPER CLASSES ***************/
    //static class HS extends HashSet<Integer>{public HS(){super();}public HS(int a){super(a);}};
	//static class AL extends ArrayList<Integer>{public AL(){super();}public AL(int a){super (a);}};
	static class Pair implements Comparable<Pair> {
		int i,j;long L; public Pair(int xx, int yy, long LL){i=xx;j=yy;L=LL;} 
		public int compareTo(Pair p) { return (this.L < p.L) ? -1 : ((this.L == p.L && this.i < p.i) ? -1 : 1);}
	}
	/************** FAST IO CODE FOLLOWS *****************/
	public static long nextLong() throws Throwable {
		long i = System.in.read();boolean neg = false;while (i < 33) i = System.in.read();if (i == 45) {neg=true;i=48;}i = i - 48;
		int j = System.in.read();while (j > 32) {i*=10;i+=j-48;j = System.in.read();}return (neg) ? -i : i;
	}
	public static int nextInt() throws Throwable {return (int)nextLong();}
	public static String next() throws Throwable {
		int i = 0; while (i < 33 && i != -1) i = System.in.read(); int cptr = 0; while (i >= 33) { in[cptr++] = (char)i; i = System.in.read();}
		return new String(in, 0,cptr);
	}
	/**** LIBRARIES ****/
	public static long gcdL(long a, long b) {while (b != 0) {long tmp = b;b = (a % b);a = tmp;}return a;}
	public static int gcd(int a, int b) {while (b != 0) {int tmp = b;b = (a % b);a = tmp;}return a;}
	public static int[] sieve(int LIM) {
		int i,count = 0;
		boolean [] b = new boolean [LIM];
		for (i = 2;i<LIM; ++i) if (!b[i]) {count++; for (int j = i<<1; j<LIM; j+=i) b[j] = true;}
		int [] primes = new int[count];
		for (i = 2,count=0;i<LIM;++i) if (!b[i]) primes[count++] = i;
		return primes;
	}
	public static int[] numPrimeFactors(int LIM) {
		int i,count = 0;
		int [] b = new int [LIM];
		for (i = 2;i<LIM; ++i) if (b[i] == 0) {count++; for (int j = i; j<LIM; j+=i) b[j]++;}
		return b;
	}
	public static StringBuilder stringFromArray(int [] a) {
		StringBuilder b = new StringBuilder(9*a.length);
		for (int i = 0; i<a.length; ++i) {
			if (i != 0) b = b.append(' ');
			b = b.append(a[i]);
		}
		return b;
	}
	public static long modPow (long a, long n, long MOD) { long S = 1; for (;n > 0; n>>=1, a=(a*a)%MOD) if ((n & 1) != 0) S = (a*S) % MOD; return S;}
}

/* Full Problem Text:
  
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.

 */