Many modern text editors automatically check the spelling of the user's text. Some editors even suggest how to correct typos.

In this problem your task to implement a small functionality to correct two types of typos in a word. We will assume that three identical letters together is a typo (for example, word "helllo" contains a typo). Besides, a couple of identical letters immediately followed by another couple of identical letters is a typo too (for example, words "helloo" and "wwaatt" contain typos).

Write a code that deletes the minimum number of letters from a word, correcting described typos in the word. You are allowed to delete letters from both ends and from the middle of the word.

Input

The single line of the input contains word s, its length is from 1 to 200000 characters. The given word s consists of lowercase English letters.

Output

Print such word t that it doesn't contain any typos described in the problem statement and is obtained from s by deleting the least number of letters.

If there are multiple solutions, print any of them.

Examples

Input

helloo


Output

hello


Input

woooooow


Output

woow

Note

The second valid answer to the test from the statement is "heloo".
import java.util.*;
import java.io.*;
public class FixingTypos
{

    
    /************************ SOLUTION STARTS HERE ***********************/


    
    private static void solve(FastScanner s1, PrintWriter out){

	String str = s1.nextLine();
	StringBuilder temp1 = new StringBuilder();
	int ptr = 0;
	int len = str.length();
	while(ptr < len){
	    int i = ptr;
	    int cnt = 0;
	    while(i < len && str.charAt(i) == str.charAt(ptr)){
		cnt++;
		i++;
	    }
	    for(int j=1;j<=Math.min(cnt,2);j++)
			temp1.append(str.charAt(ptr));
	    ptr += cnt;
	}
	char[] s = temp1.toString().toCharArray();
	StringBuilder ans = new StringBuilder();
	int length = s.length;
	ArrayList<Integer> grp = new ArrayList<>();
	ArrayList<Integer> normal = new ArrayList<Integer>();
	for(int i=0;i<length;){

		if(i + 3 < length && s[i] == s[i+1] && s[i + 2] == s[i + 3]){

			int start = i;
			while(start + 1 < length && s[start] == s[start + 1]){
				start += 2;
			}
			grp.add(start - 1);
			i = start;
		}
		else{
			normal.add(i++);			
		}

	}
		int ptr1 = 0;
		int ptr2 = 0;
		for(int i=0;i<length;){
			if(normal.size() > 0 && ptr2 < normal.size() && i == normal.get(ptr2)){
				ans.append(s[i]);
				i++;
				ptr2++;
			}
			else{
				ans.append(s[i]);
				ans.append(s[i + 1]);
				i += 2;
				while(i <= grp.get(ptr1)){
					ans.append(s[i]);
					if(i + 3 <= grp.get(ptr1)){
					ans.append(s[i + 2]);
					ans.append(s[i + 3]);
					i += 4;					
					}
					else
						i+=2;
				}
				ptr1++;
			}
		}

		out.println(ans);
    }


    
    /************************ SOLUTION ENDS HERE ************************/
    
    
    
    
    
    /************************ TEMPLATE STARTS HERE *********************/

    public static void main(String []args) throws IOException {
	FastScanner in  = new FastScanner(System.in);
	PrintWriter out = 
		new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), false); 
	solve(in, out);
	in.close();
	out.close();
    }    

    static class FastScanner{
	BufferedReader reader;
	StringTokenizer st;
	FastScanner(InputStream stream){reader=new BufferedReader(new InputStreamReader(stream));st=null;}	
	String next()
	    {while(st == null || !st.hasMoreTokens()){try{String line = reader.readLine();if(line == null){return null;}		    
	     st = new StringTokenizer(line);}catch (Exception e){throw new RuntimeException();}}return st.nextToken();}
	String nextLine()  {String s=null;try{s=reader.readLine();}catch(IOException e){e.printStackTrace();}return s;}	    	  	
	int    nextInt()   {return Integer.parseInt(next());}
	long   nextLong()  {return Long.parseLong(next());}		
	double nextDouble(){return Double.parseDouble(next());}
	char   nextChar()  {return next().charAt(0);}
	int[]  nextIntArray(int n)         {int[] arr= new int[n];   int i=0;while(i<n){arr[i++]=nextInt();}  return arr;}
	long[] nextLongArray(int n)        {long[]arr= new long[n];  int i=0;while(i<n){arr[i++]=nextLong();} return arr;}	
	int[]  nextIntArrayOneBased(int n) {int[] arr= new int[n+1]; int i=1;while(i<=n){arr[i++]=nextInt();} return arr;}	    	
	long[] nextLongArrayOneBased(int n){long[]arr= new long[n+1];int i=1;while(i<=n){arr[i++]=nextLong();}return arr;}	    	
	void   close(){try{reader.close();}catch(IOException e){e.printStackTrace();}}				
    }

    /************************ TEMPLATE ENDS HERE ************************/
}