Polycarp thinks about the meaning of life very often. He does this constantly, even when typing in the editor. Every time he starts brooding he can no longer fully concentrate and repeatedly presses the keys that need to be pressed only once. For example, instead of the phrase "how are you" he can type "hhoow aaaare yyoouu". 

Polycarp decided to automate the process of correcting such errors. He decided to write a plug-in to the text editor that will remove pairs of identical consecutive letters (if there are any in the text). Of course, this is not exactly what Polycarp needs, but he's got to start from something! 

Help Polycarp and write the main plug-in module. Your program should remove from a string all pairs of identical letters, which are consecutive. If after the removal there appear new pairs, the program should remove them as well. Technically, its work should be equivalent to the following: while the string contains a pair of consecutive identical letters, the pair should be deleted. Note that deleting of the consecutive identical letters can be done in any order, as any order leads to the same result. 

Input

The input data consists of a single line to be processed. The length of the line is from 1 to 2·105 characters inclusive. The string contains only lowercase Latin letters. 

Output

Print the given string after it is processed. It is guaranteed that the result will contain at least one character.

Examples

Input

hhoowaaaareyyoouu


Output

wre

Input

reallazy


Output

rezy

Input

abacabaabacabaa


Output

a
import java.io.*;
import java.math.*;
import java.util.*;
import java.util.List;
import java.util.Queue;
import java.awt.*;

public class codefors implements Runnable {

    private BufferedReader br = null;
    private PrintWriter pw = null;
    private StringTokenizer stk = new StringTokenizer("");

    public static void main(String[] args) {
        new Thread(new codefors()).run();
    }

    public void run() {
        /*
         * try { // br = new BufferedReader(new FileReader("input.txt")); pw =
         * new PrintWriter("output.txt"); } catch (FileNotFoundException e) {
         * e.printStackTrace(); }
         */
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new OutputStreamWriter(System.out));
        solver();
        pw.close();

    }

    private void nline() {
        try {
            if (!stk.hasMoreTokens())
                stk = new StringTokenizer(br.readLine());
        } catch (IOException e) {
            throw new RuntimeException("KaVaBUnGO!!!", e);
        }
    }

    private String nstr() {
        while (!stk.hasMoreTokens())
            nline();
        return stk.nextToken();
    }

    private int ni() {
        return Integer.valueOf(nstr());

    }

    private double nd() {
        return Double.valueOf(nstr());

    }

    String nextLine() {
        try {
            return br.readLine();
        } catch (IOException e) {
        }
        return null;
    }

    void task_A() {
        BigInteger bi = nbi();
        BigInteger lb = new BigInteger("-128");
        BigInteger rb = new BigInteger("127");
        BigInteger ls = new BigInteger("-32768");
        BigInteger rs = new BigInteger("32767");
        BigInteger li = new BigInteger("-2147483648");
        BigInteger ri = new BigInteger("2147483647");
        BigInteger ll = new BigInteger("-9223372036854775808");
        BigInteger rl = new BigInteger("9223372036854775807");

        if (rb.equals(bi.max(rb)) && lb.equals(bi.min(lb))) {
            System.out.println("byte");
            return;
        }
        ;
        if (rs.equals(bi.max(rs)) && ls.equals(bi.min(ls))) {
            System.out.println("short");
            return;
        }
        ;
        if (ri.equals(bi.max(ri)) && li.equals(bi.min(li))) {
            System.out.println("int");
            return;
        }
        ;
        if (rl.equals(bi.max(rl)) && ll.equals(bi.min(ll))) {
            System.out.println("long");
            return;
        }
        ;

        System.out.println("BigInteger");
    }

    void task_B() {
        int n = ni();
        int a[] = new int[n + 1];
        for (int i = 0; i < n; i++) {
            a[i] = ni();
        }
        int dpl[] = new int[n];
        int dpr[] = new int[n];
        dpl[0] = 0;
        dpr[n - 1] = 0;
        for (int i = 1; i < n; i++) {
            if (a[i] >= a[i - 1])
                dpl[i] = dpl[i - 1] + 1;
        }
        for (int i = n - 2; i >= 0; i--) {
            if (a[i] >= a[i + 1])
                dpr[i] = dpr[i + 1] + 1;
        }
        int f = 0;
        int max = 0;
        for (int i = 0; i < n; i++) {
            if (dpl[i] + dpr[i] > max) {
                max = dpl[i] + dpr[i];
                f = i;
            }
        }
        System.out.println(max + 1);
    }

    int nod(int a, int b) {
        if (a % b == 0)
            return b;
        return nod(b, a % b);
    }

    void task_C() {
        int n = ni();
        int a[] = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = ni();
        for (int i = 1; i < n; i++)
            System.out.println(nod(a[i - 1], a[i]));
    }

    
    
    public static int n,m;
    
    private void solver() {
        
        char c[], d[];
        String s = nstr();
        s+=" ";
        c = s.toCharArray();
        d = new char[s.length()];
        int l = 0, r = 0;
        boolean flag = false;
        while(r<c.length-1){
            if(l==0){
                d[l]=c[r];
                l++;
                r++;
            }else{
                if(!flag){
                d[l]=c[r];
                l++;
                r++;}
            }
            if(c[r]==d[l-1]){
                l--;
                r++;
                flag=true;
            }else{
                flag=false;
            }
        
        }
        
        for(int i =0; i<l;i++)
        System.out.print(d[i]);
        /*
        n = ni();
        m = ni();
        
        int mas[][] = new int[n][m];
        int map[][] = new int[n][m];
        for(int i=0; i<n; i++){
            for(int j =0; j<m; j++){
                mas[i][j]=ni();
                map[i][j]=10000;
                
            }
        }
        
        int x = ni(), y =ni();
        
        map[0][0]=0;
        Stack<Point> st = new Stack<Point>();
        Point p = new Point();
        p.x = 0;
        p.y = 0;
        
        st.add(p);
        
        while(!st.isEmpty()){
            Point p0 = st.pop();
            Point p1 = new Point(p0.x+2,p0.y);
            Point p2 = new Point(p0.x,p0.y+2);
            Point p3 = new Point(p0.x-2,p0.y);
            Point p4 = new Point(p0.x,p0.y-2);
            if(check(p1) && mas[p0.y][p0.x+1]==mas[p0.y][p0.x+2] &&  ((map[p0.y][p0.x]+1) <map[p0.y][p0.x+2])){
            
                st.push(p1);
                map[p0.y][p0.x+2]=map[p0.y][p0.x]+1;
            }
            if(check(p2) && mas[p0.y+1][p0.x]==mas[p0.y+2][p0.x] &&  ((map[p0.y][p0.x]+1) < map[p0.y+2][p0.x])){
                st.push(p2);
                map[p0.y+2][p0.x]=map[p0.y][p0.x]+1;
            }
            if(check(p3) && mas[p0.y][p0.x-1]==mas[p0.y][p0.x-2] &&  map[p0.y][p0.x]+1 <map[p0.y][p0.x-2]){
                st.push(p3);
                map[p0.y][p0.x-2]=map[p0.y][p0.x]+1;
            }
            if(check(p4) && mas[p0.y-1][p0.x]==mas[p0.y-2][p0.x] &&  map[p0.y][p0.x]+1 <map[p0.y-2][p0.x]){
                st.push(p4);
                map[p0.y-2][p0.x]=map[p0.y][p0.x]+1;
            }
            
        }
        
       System.out.println(map[x-1][y-1]);
        

       Point t = new Point(x-1,y-1);
       int u = map[x-1][y-1];
       
       while(true){
           System.out.println(mas[t.x][t.y]);
        if(u==0)break;   
        Point t1 = new Point(t.x+2, t.y);
        Point t2 = new Point(t.x, t.y+2);
        Point t3 = new Point(t.x-2, t.y);
        Point t4 = new Point(t.x, t.y-2);
        if(check(t1) && (map[t1.y][t1.x]-u) ==1){
            t = (Point) t1.clone();
            --u;
            continue;
        }
        if(check(t2) && map[t2.y][t2.x]-u==1){
            t = (Point) t2.clone();
            --u;
            continue;
        }if(check(t3) && map[t3.y][t3.x]-u==1){
            t = (Point) t3.clone();
            --u;
            continue;
        }if(check(t4) && map[t4.y][t4.x]-u==1){
            t = (Point) t4.clone();
            --u;
            continue;
        }
        
        
        
       }
       
        /*BigInteger bi = new BigInteger("2");
        BigInteger max = new BigInteger("1000000000000000");
        BigInteger r = new BigInteger("1");
        int k = 1;
        while (true) {
            r = bi.pow(k++);
            if (r.compareTo(max) > 0)
                break;

        }

        System.out.println(k);
        System.out.println("1000000000000000");
        System.out.println(bi.pow(49));
        System.out.println( max.add(bi.pow(49).negate()) );*/

    }

    boolean check(Point p){
        if(p.x <0 || p.y<0 || p.x>=m || p.y >=n) return false;
        
        
        
        return true;
    }
    
    private BigInteger nbi() {
        return new BigInteger(nstr());
    }

    void exit() {

        System.exit(0);
    }
}
