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.io.*;
import java.math.BigInteger;
import java.util.*;
	
	
	public class Main {
		private static InputStream stream;
		private static byte[] buf = new byte[1024];
		private static int curChar;
		private static int numChars;
		private static SpaceCharFilter filter;
		private static PrintWriter pw;
		private static long mod=1073741824;
	
	    public static void main(String[] args) {
	    	InputReader(System.in);
			pw = new PrintWriter(System.out); 
	        new Thread(null ,new Runnable(){
	           public void run(){
	               try{
	                   solve();//This is solution method
	                   pw.close();
	               } catch(Exception e){
	                   e.printStackTrace();
	               }
	           }
	       },"1",1<<26).start();
	   }
	
    	public static void solve() {



    		String word = nextLine();
    		StringBuilder result = new StringBuilder();
    		
    		int prevCount = 0;
    		int currCount = 1;
    		char currChar = ',';
    		
    		for (int i=0; i<word.length(); i++) {
    			if (word.charAt(i) != currChar) {
    				currChar = word.charAt(i);
    				prevCount = currCount;
    				currCount = 1;
    			} else {
    				currCount++;
    				
    				if ((currCount > 2) || 
    						((currCount == 2) && (currCount == prevCount))) {
    					currCount--;
    					continue;
    				}
    			}
    			
    			result.append(currChar);
    		}
    		
    		pw.println(result);
    		
    		}
    	public static boolean check(int freq[],int req_freq[],int que){
    		for(int i=0;i<26;i++){
    			if(req_freq[i]<freq[i]){
    				return false;
    			}
    			int diff=req_freq[i]-freq[i];
    			if(que<diff){
    				return false;
    			}else{
    				que-=diff;
    			}
    		}
    		return true;
    	}

		public static void InputReader(InputStream stream1) {
			stream = stream1;
		}
	 
		private static boolean isWhitespace(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	 
		private static boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
	 
		private static int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
	 
		private static int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
	 
		private static long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
	 
		private static String nextToken() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}
	 
		private static String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}
	 
		private static int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}
	 
		private static int[][] next2dArray(int n, int m) {
			int[][] arr = new int[n][m];
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < m; j++) {
					arr[i][j] = nextInt();
				}
			}
			return arr;
		}
		private static char[][] nextCharArray(int n,int m){
			char [][]c=new char[n][m];
			for(int i=0;i<n;i++){
				String s=nextLine();
				for(int j=0;j<s.length();j++){
					c[i][j]=s.charAt(j);
				}
			}
			return c;
		}
	 
		private static long[] nextLongArray(int n) {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}
	 
		private static void pArray(int[] arr) {
			for (int i = 0; i < arr.length; i++) {
				pw.print(arr[i] + " ");
			}
			pw.println();
			return;
		}
	 
		private static void pArray(long[] arr) {
			for (int i = 0; i < arr.length; i++) {
				pw.print(arr[i] + " ");
			}
			pw.println();
			return;
		}
	 
		private static void pArray(boolean[] arr) {
			for (int i = 0; i < arr.length; i++) {
				pw.print(arr[i] + " ");
			}
			pw.println();
			return;
		}
	 
		private static boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return isWhitespace(c);
		}
	 
		private interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	
		
	}	
