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.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.Arrays;

public class E {

	static int N;
	static int c[], res[];
	static int freq[];
	static char map[];
	static int toNextNum[];
	public static void main(String[] args) {
		JS in = new JS();
		PrintWriter out = new PrintWriter(System.out);
		char tmp[] = in.next().toCharArray();
		N = tmp.length;
		c = new int[N]; res = new int[N];
		freq = new int[3]; map = new char[3];
		toNextNum = new int[3];
		Arrays.fill(res, -1);
		for(int i = 0; i < N; i++) {
			c[i] = tmp[i]-'a';
			freq[c[i]]++;
		}
		
		data d[] = new data[3];
		for(int i = 0; i < 3; i++)
			d[i] = new data(i, freq[i]);
		Arrays.sort(d);
		
		for(int i = 0; i < 3; i++) {
			map[i] = (char)('a'+d[i].num);
			toNextNum[d[i].num] = i;
		}
		for(int i = 0; i < N; i++) {
			c[i] = toNextNum[c[i]];
		}
		
		//take all 0's
		for(int i = 0; i < N; i++) {
			if(c[i] == 0)res[i] = 0;
		}
		//take all 1's
		int l = 0;
		int r = N-1;
		ArrayDeque<Integer> stack = new ArrayDeque<Integer>();
		while(l <= r) {
			while(res[l] != 0) {
				if(c[l] == 1) stack.add(l);
				l++;
			}
			while(res[r] != 0) {
				if(r <= l) {
					while(stack.size() > 0) {
						res[stack.poll()] = 1;
					}
					break;
				}
				if(c[r] == 1) {
					if(!stack.isEmpty()) {
						res[stack.poll()] = 1;
						res[r] = 1;
					}
				}
				r--;
			}
			l++;
			r--;
			stack.clear();
		}
		
		//take all 2s
		stack.clear();
		l = 0;
		r = N-1;
		while(l <= r) {
			while(res[l] == -1) {
				if(c[l] == 2) stack.add(l);
				l++;
			}
			while(res[r] == -1) {
				if(r <= l) {
					while(stack.size() > 0) {
						res[stack.poll()] = 2;
					}
					break;
				}
				if(c[r] == 2) {
					if(!stack.isEmpty()) {
						res[stack.poll()] = 2;
						res[r] = 2;
					}
				}
				r--;
			}
			l++;
			r--;
			stack.clear();
		}
		
		int cnt = 0;
		for(int i = 0; i < N; i++) {
			if(res[i] != -1) cnt++;
		}
		
		if(cnt < N/2) {
			out.println("IMPOSSIBLE");
			out.close();
			return;
		}
		
		for(int i = 0; i < N; i++) {
			if(res[i] == -1) continue;
			out.print(map[res[i]]);
		}
		out.println();
		out.close();
		
	}
	
	static class data implements Comparable<data>{
		int num, cnt;
		public data(int nn, int cc) {
			num=nn;
			cnt=cc;
		}
		@Override
		public int compareTo(data o) {
			return o.cnt-cnt;
		}
	}
	
	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}				
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
		    while(c!='.'&&c!='-'&&(c <'0' || c>'9')) c = nextChar();
		    boolean neg = c=='-';
		    if(neg)c=nextChar();
		    boolean fl = c=='.';
		    double cur = nextLong();
		    if(fl) return neg ? -cur/num : cur/num;
		    if(c == '.') {
			double next = nextLong();
			return neg ? -cur-next/num : cur+next/num;
		    }
		    else return neg ? -cur : cur;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}

}