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.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;
import java.util.LinkedList;
public class EGlobalRound4 {

	public static void main(String[] args) {
		FastScanner in = new FastScanner(System.in);
		String g = in.next();
		int N = g.length();
		int[] arr = new int[N];
		for(int i = 0; i < N; i++) {
			arr[i] = g.charAt(i) - 'a';
		}
		
		StringBuilder sb = helper(N, arr, 0, 0);
		System.out.println(sb);
	}
	
	public static String ans(int N, int[] arr) {
		
		
		
		
		return null;
	}
	
	public static StringBuilder helper(int N, int[] arr, int first, int second) {
		@SuppressWarnings("unchecked")
		LinkedList<Integer>[] pos = new LinkedList[3];
		for(int i = 0; i < 3; i++)
			pos[i] = new LinkedList<>();
		
		for(int i = 0; i < N; i++) {
			pos[arr[i]].add(i);
		}
		
		
		int head = -1;
		int tail = N;
		int size = 0;
		StringBuilder sb = new StringBuilder();
		while(head <= tail) {
	//		System.out.println("head,tail = " + head + ", " + tail);
			if(head == tail && (arr[head] == first || arr[head] == second)) {
	//			sb.append((char) (arr[head] + 'a'));
	//			System.out.println("??????????");
				break;
			}
			
	//		System.out.println("befpre = " + Arrays.toString(pos));
			
			int[][] next = new int[3][2];
			
			for(int i = 0; i < 3; i++) {
				if(pos[i].size() > 0) {
					next[i][0] = pos[i].getFirst();
					next[i][1] = pos[i].getLast();
				}
				else {
					next[i][0] = -1;
					next[i][1] = -3;
				}
			}
			
			
			int index = -1;
			int max = -1;
			
			for(int i = 0; i < 3; i++) {
				int temp = next[i][1] - next[i][0];
				if(temp > max) {
					max = temp;
					index = i;
				}
			}
			
			if(index == -1) {
	//			System.out.println("AHH BREAK");
				break;
			}
			
			sb.append((char) (index + 'a'));
			
			head = next[index][0];
			tail = next[index][1];
	//		System.out.println("head,tail Result = " + head + ", " + tail);
			if(head != tail)
				size++;
			
	//		System.out.println("index = " + index);
			pos[index].removeFirst();
			
			if(head != tail)
				pos[index].removeLast();
			
			for(int i = 0; i < 3; i++) {
				while(pos[i].size() > 0 && pos[i].getFirst() <= head) {
					pos[i].removeFirst();
				}
				while(pos[i].size() > 0 && pos[i].getLast() >= tail) {
					pos[i].removeLast();
				}
			}
			
			
	//		System.out.println("afterward: " + Arrays.toString(pos));
	//		System.out.println();
			
		}
		
		String temp = sb.toString();
		StringBuilder sb2 = new StringBuilder();
		sb2.append(temp);
		for(int i = size-1; i >= 0; i--) {
			sb2.append(temp.charAt(i));
		}
		
		return sb2;
	}
	
	/**
	 * Source: Matt Fontaine
	 */
	static class FastScanner {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int chars;

		public FastScanner(InputStream stream) {
			this.stream = stream;
		}

		int read() {
			if (chars == -1)
				throw new InputMismatchException();
			if (curChar >= chars) {
				curChar = 0;
				try {
					chars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (chars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		boolean isEndline(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String next() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public String nextLine() {
			int c = read();
			while (isEndline(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndline(c));
			return res.toString();
		}
	}

}
/*
cacbac
outputCopy
aba
inputCopy
abc
outputCopy
a
inputCopy
cbacacacbcbababacbcb
outputCopy
cbaaacbcaaabc
*/