import static java.lang.Math.*;
import java.util.*;
import java.io.*;

public class yandex_q1_A {

    public void solve() throws Exception {
        String s = nextWord();

        boolean b = true;
        while (b) {
//          debug(s);
            if (!b || s.length()<=1) {println(s); return;}
            StringBuilder sb = new StringBuilder();
            b=false;
            for (int i=0; i<s.length(); i++) {
                char c = s.charAt(i);
                boolean bb = false;
                while (i<s.length()-1 && s.charAt(i+1)==c) {
                    i++; b=bb=true;
                }
                if (!bb) sb.append(c);
            }
            s=sb.toString();
        }
        println(s);
    }

    ////////////////////////////////////////////////////////////////////////////

    double EPS = 1e-7;
    int INF = Integer.MAX_VALUE;
    long INFL = Long.MAX_VALUE;
    double INFD = Double.MAX_VALUE;

    int[] dx = {0,1,0,-1};
    int[] dy = {-1,0,1,0};
    int[] dx8 = {0,1,1,1,0,-1,-1,-1};
    int[] dy8 = {-1,-1,0,1,1,1,0,-1};
    int[] knightMovesX = {1,2,2,1,-1,-2,-2,-1};
    int[] knightMovesY = {-2,-1,1,2,2,1,-1,-2};

    class Point {
        int x,y;
        public Point(int xx, int yy) {
            x=xx; y=yy;
        }
        public double dist(Point p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    class PointL {
        long x,y;
        public PointL(long xx, long yy) {
            x=xx; y=yy;
        }
        public double dist(PointL p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    class PointD {
        double x,y;
        public PointD(double xx, double yy) {
            x=xx; y=yy;
        }
        public double dist(PointD p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    double dist(int x, int y, int xx, int yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }
    double dist(long x, long y, long xx, long yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }
    double dist(double x, double y, double xx, double yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }

    @SuppressWarnings("serial")
    class IncMap extends HashMap<Object, Integer> {
        boolean add(Object key) {
            Integer i = get(key);
            if (i!=null) {
                put(key, i+1);
                return false;
            } else {
                put(key, 1);
                return true;
            }
        }
    }

    int min(int... nums) {
        int r = INF;
        for (int i: nums)
            if (i<r) r = i;
        return r;
    }
    int max(int... nums) {
        int r = -INF;
        for (int i: nums)
            if (i>r) r = i;
        return r;
    }
    long minL(long... nums) {
        long r = INFL;
        for (long i: nums)
            if (i<r) r = i;
        return r;
    }
    long maxL(long... nums) {
        long r = -INFL;
        for (long i: nums)
            if (i>r) r = i;
        return r;
    }

    int digitSum(long i) {
        i = abs(i);
        int r = 0;
        while (i>0) {
            r+=i%10;
            i/=10;
        }
        return r;
    }
    long digitProd(long i) {
        if (i==0) return 0;
        i = abs(i);
        long r = 1;
        while (i>0) {
            r*=i%10;
            i/=10;
        }
        return r;
    }

    double log2(long i) {
        return log(i)/log(2);
    }
    double log2(double i) {
        return log(i)/log(2);
    }
    long binpow(int x, int n) {
        long r = 1;
        while (n>0) {
            if ((n&1)!=0) r*=x;
            x*=x;
            n>>=1;
        }
        return r;
    }

    int[] months = {0,31,28,31,30,31,30,31,31,30,31,30,31};
    boolean isLeapYear(int y) {
        return y%4==0 && (y%400==0 || y%100!=0);
    }
    boolean isValidDate(int d, int m, int y) {
        if (isLeapYear(y) && m==2 && d==29) return true;
        return m>0 && m<=12 && d>0 && d<=months[d];
    }
    int[] nextDay(int d, int m, int y) {
        if (d>=months[m])
            if (m==2 && d==28 && isLeapYear(y)) d++;
            else {d=1; m++;}
        else
            d++;
        if (m==13) {d=1; m=1; y++;}
        return new int[] {d,m,y};
    }

    long timer = System.currentTimeMillis();
    void startTimer() {
        timer = System.currentTimeMillis();
    }
    void stopTimer() {
        System.err.println("time: "+(System.currentTimeMillis()-timer)/1000.0);
    }

    static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));

    String nextLine() throws IOException {
        return in.readLine();
    }
    String nextWord() throws IOException {
        StringBuilder sb = new StringBuilder();
        int c = 0;
        while (c<=' ') c=in.read();
        while (c>' ') {
            sb.append((char)c);
            c = in.read();
        }
        return sb.toString();
    }
    int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextWord());
    }
    long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextWord());
    }
    double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextWord());
    }

    void print(Object o) throws IOException {
        out.write(o.toString());
    }
    void println(Object o) throws IOException {
        out.write(o.toString());
        out.newLine();
    }
    void print(Object... o) throws IOException {
        out.write(o[0].toString());
        for (int i=1; i<o.length; i++)
            out.write(" "+o[i].toString());
    }
    void println(Object... o) throws IOException {
        print(o);
        out.newLine();
    }

    void debug(Object... o) {
        System.err.println(Arrays.deepToString(o));
    }

    public static void main(String[] args) throws Exception {
        Locale.setDefault(Locale.US);
        new yandex_q1_A().solve();
        out.flush();
        out.close(); in.close();
    }
}


import static java.lang.Math.*;
import java.util.*;
import java.io.*;

public class yandex_q1_A {

    public void solve() throws Exception {
        String s = nextWord();
        StringBuilder sb = new StringBuilder();

        for (int i=0; i<s.length(); i++)
            if (sb.length()>0 && sb.charAt(sb.length()-1)==s.charAt(i)) sb.deleteCharAt(sb.length()-1);
            else sb.append(s.charAt(i));

        println(sb.toString());
    }

    ////////////////////////////////////////////////////////////////////////////

    double EPS = 1e-7;
    int INF = Integer.MAX_VALUE;
    long INFL = Long.MAX_VALUE;
    double INFD = Double.MAX_VALUE;

    int[] dx = {0,1,0,-1};
    int[] dy = {-1,0,1,0};
    int[] dx8 = {0,1,1,1,0,-1,-1,-1};
    int[] dy8 = {-1,-1,0,1,1,1,0,-1};
    int[] knightMovesX = {1,2,2,1,-1,-2,-2,-1};
    int[] knightMovesY = {-2,-1,1,2,2,1,-1,-2};

    class Point {
        int x,y;
        public Point(int xx, int yy) {
            x=xx; y=yy;
        }
        public double dist(Point p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    class PointL {
        long x,y;
        public PointL(long xx, long yy) {
            x=xx; y=yy;
        }
        public double dist(PointL p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    class PointD {
        double x,y;
        public PointD(double xx, double yy) {
            x=xx; y=yy;
        }
        public double dist(PointD p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    double dist(int x, int y, int xx, int yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }
    double dist(long x, long y, long xx, long yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }
    double dist(double x, double y, double xx, double yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }

    @SuppressWarnings("serial")
    class IncMap extends HashMap<Object, Integer> {
        boolean add(Object key) {
            Integer i = get(key);
            if (i!=null) {
                put(key, i+1);
                return false;
            } else {
                put(key, 1);
                return true;
            }
        }
    }

    int min(int... nums) {
        int r = INF;
        for (int i: nums)
            if (i<r) r = i;
        return r;
    }
    int max(int... nums) {
        int r = -INF;
        for (int i: nums)
            if (i>r) r = i;
        return r;
    }
    long minL(long... nums) {
        long r = INFL;
        for (long i: nums)
            if (i<r) r = i;
        return r;
    }
    long maxL(long... nums) {
        long r = -INFL;
        for (long i: nums)
            if (i>r) r = i;
        return r;
    }

    int digitSum(long i) {
        i = abs(i);
        int r = 0;
        while (i>0) {
            r+=i%10;
            i/=10;
        }
        return r;
    }
    long digitProd(long i) {
        if (i==0) return 0;
        i = abs(i);
        long r = 1;
        while (i>0) {
            r*=i%10;
            i/=10;
        }
        return r;
    }

    double log2(long i) {
        return log(i)/log(2);
    }
    double log2(double i) {
        return log(i)/log(2);
    }
    long binpow(int x, int n) {
        long r = 1;
        while (n>0) {
            if ((n&1)!=0) r*=x;
            x*=x;
            n>>=1;
        }
        return r;
    }

    int[] months = {0,31,28,31,30,31,30,31,31,30,31,30,31};
    boolean isLeapYear(int y) {
        return y%4==0 && (y%400==0 || y%100!=0);
    }
    boolean isValidDate(int d, int m, int y) {
        if (isLeapYear(y) && m==2 && d==29) return true;
        return m>0 && m<=12 && d>0 && d<=months[d];
    }
    int[] nextDay(int d, int m, int y) {
        if (d>=months[m])
            if (m==2 && d==28 && isLeapYear(y)) d++;
            else {d=1; m++;}
        else
            d++;
        if (m==13) {d=1; m=1; y++;}
        return new int[] {d,m,y};
    }

    long timer = System.currentTimeMillis();
    void startTimer() {
        timer = System.currentTimeMillis();
    }
    void stopTimer() {
        System.err.println("time: "+(System.currentTimeMillis()-timer)/1000.0);
    }

    static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));

    String nextLine() throws IOException {
        return in.readLine();
    }
    String nextWord() throws IOException {
        StringBuilder sb = new StringBuilder();
        int c = 0;
        while (c<=' ') c=in.read();
        while (c>' ') {
            sb.append((char)c);
            c = in.read();
        }
        return sb.toString();
    }
    int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextWord());
    }
    long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextWord());
    }
    double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextWord());
    }

    void print(Object o) throws IOException {
        out.write(o.toString());
    }
    void println(Object o) throws IOException {
        out.write(o.toString());
        out.newLine();
    }
    void print(Object... o) throws IOException {
        out.write(o[0].toString());
        for (int i=1; i<o.length; i++)
            out.write(" "+o[i].toString());
    }
    void println(Object... o) throws IOException {
        print(o);
        out.newLine();
    }

    void debug(Object... o) {
        System.err.println(Arrays.deepToString(o));
    }

    public static void main(String[] args) throws Exception {
        Locale.setDefault(Locale.US);
        new yandex_q1_A().solve();
        out.flush();
        out.close(); in.close();
    }
}


import static java.lang.Math.*;
import java.util.*;
import java.io.*;

public class yandex_q1_A {

    public void solve() throws Exception {
        String s = nextWord();

        boolean b = true;
        while (b) {
//          debug(s);
            if (!b || s.length()<=1) {println(s); return;}
            StringBuilder sb = new StringBuilder();
            b=false;
            for (int i=0; i<s.length(); i++) {
                char c = s.charAt(i);
                boolean bb = false;
                while (i<s.length()-1 && s.charAt(i+1)==c) {
                    i++; b=bb=true;
                }
                if (!bb) sb.append(c);
            }
            s=sb.toString();
        }
    }

    ////////////////////////////////////////////////////////////////////////////

    double EPS = 1e-7;
    int INF = Integer.MAX_VALUE;
    long INFL = Long.MAX_VALUE;
    double INFD = Double.MAX_VALUE;

    int[] dx = {0,1,0,-1};
    int[] dy = {-1,0,1,0};
    int[] dx8 = {0,1,1,1,0,-1,-1,-1};
    int[] dy8 = {-1,-1,0,1,1,1,0,-1};
    int[] knightMovesX = {1,2,2,1,-1,-2,-2,-1};
    int[] knightMovesY = {-2,-1,1,2,2,1,-1,-2};

    class Point {
        int x,y;
        public Point(int xx, int yy) {
            x=xx; y=yy;
        }
        public double dist(Point p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    class PointL {
        long x,y;
        public PointL(long xx, long yy) {
            x=xx; y=yy;
        }
        public double dist(PointL p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    class PointD {
        double x,y;
        public PointD(double xx, double yy) {
            x=xx; y=yy;
        }
        public double dist(PointD p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    double dist(int x, int y, int xx, int yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }
    double dist(long x, long y, long xx, long yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }
    double dist(double x, double y, double xx, double yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }

    @SuppressWarnings("serial")
    class IncMap extends HashMap<Object, Integer> {
        boolean add(Object key) {
            Integer i = get(key);
            if (i!=null) {
                put(key, i+1);
                return false;
            } else {
                put(key, 1);
                return true;
            }
        }
    }

    int min(int... nums) {
        int r = INF;
        for (int i: nums)
            if (i<r) r = i;
        return r;
    }
    int max(int... nums) {
        int r = -INF;
        for (int i: nums)
            if (i>r) r = i;
        return r;
    }
    long minL(long... nums) {
        long r = INFL;
        for (long i: nums)
            if (i<r) r = i;
        return r;
    }
    long maxL(long... nums) {
        long r = -INFL;
        for (long i: nums)
            if (i>r) r = i;
        return r;
    }

    int digitSum(long i) {
        i = abs(i);
        int r = 0;
        while (i>0) {
            r+=i%10;
            i/=10;
        }
        return r;
    }
    long digitProd(long i) {
        if (i==0) return 0;
        i = abs(i);
        long r = 1;
        while (i>0) {
            r*=i%10;
            i/=10;
        }
        return r;
    }

    double log2(long i) {
        return log(i)/log(2);
    }
    double log2(double i) {
        return log(i)/log(2);
    }
    long binpow(int x, int n) {
        long r = 1;
        while (n>0) {
            if ((n&1)!=0) r*=x;
            x*=x;
            n>>=1;
        }
        return r;
    }

    int[] months = {0,31,28,31,30,31,30,31,31,30,31,30,31};
    boolean isLeapYear(int y) {
        return y%4==0 && (y%400==0 || y%100!=0);
    }
    boolean isValidDate(int d, int m, int y) {
        if (isLeapYear(y) && m==2 && d==29) return true;
        return m>0 && m<=12 && d>0 && d<=months[d];
    }
    int[] nextDay(int d, int m, int y) {
        if (d>=months[m])
            if (m==2 && d==28 && isLeapYear(y)) d++;
            else {d=1; m++;}
        else
            d++;
        if (m==13) {d=1; m=1; y++;}
        return new int[] {d,m,y};
    }

    long timer = System.currentTimeMillis();
    void startTimer() {
        timer = System.currentTimeMillis();
    }
    void stopTimer() {
        System.err.println("time: "+(System.currentTimeMillis()-timer)/1000.0);
    }

    static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));

    String nextLine() throws IOException {
        return in.readLine();
    }
    String nextWord() throws IOException {
        StringBuilder sb = new StringBuilder();
        int c = 0;
        while (c<=' ') c=in.read();
        while (c>' ') {
            sb.append((char)c);
            c = in.read();
        }
        return sb.toString();
    }
    int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextWord());
    }
    long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextWord());
    }
    double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextWord());
    }

    void print(Object o) throws IOException {
        out.write(o.toString());
    }
    void println(Object o) throws IOException {
        out.write(o.toString());
        out.newLine();
    }
    void print(Object... o) throws IOException {
        out.write(o[0].toString());
        for (int i=1; i<o.length; i++)
            out.write(" "+o[i].toString());
    }
    void println(Object... o) throws IOException {
        print(o);
        out.newLine();
    }

    void debug(Object... o) {
        System.err.println(Arrays.deepToString(o));
    }

    public static void main(String[] args) throws Exception {
        Locale.setDefault(Locale.US);
        new yandex_q1_A().solve();
        out.flush();
        out.close(); in.close();
    }
}


import java.util.*;
public class plugin{
	public static void main(String[] args){
		Scanner br = new Scanner(System.in);
		String word = br.next();
		char[] chars = word.toCharArray();
		Stack<Character> st = new Stack<Character>();
		boolean removing = false;
		char remov = ' ';
		for(int i = 0;i<chars.length;i++){
			if(st.empty()){
				st.push(chars[i]);
			}
			else{
				if(chars[i] == st.peek()){
					removing = true;
					remov = chars[i];
				}
				else{
					if(removing){
						st.pop();
						removing = false;
						remov = ' ';
					}
					if(!st.empty() && chars[i] == st.peek())
					{
						removing = true;
						remov = chars[i];
					}
					else{
						st.push(chars[i]);
					}
				}
			}
		}
		char keeper = ' ';
		if(!st.empty() && removing && st.peek() == remov){
			keeper = st.pop();
			if(st.empty()){
				st.push(keeper);
			}
		}
		String ans = "";
		while(!st.empty()){
			ans = st.pop()+ans;
		}
		System.out.println(ans);
	}
}


import java.util.*;
public class plugin{
	public static void main(String[] args){
		Scanner br = new Scanner(System.in);
		String word = br.next();
		boolean changed = true;
		while(changed){
			changed = false;
			char cur = ' ';
			for(int i = 0;i<word.length();i++){
				if(word.charAt(i) == cur){
					String n = word.substring(0, i)+word.substring(i+1, word.length());
					word = n;
					i--;
				}
				else if(cur == ' ' && i!=word.length()-1 && word.charAt(i) == word.charAt(i+1)){
					changed = true;
					cur = word.charAt(i);
					String n = word.substring(0, i)+word.substring(i+1, word.length());
					word = n;
					i--;
				}
				else{
					cur = ' ';
				}
			}
		}
		System.out.println(word);
	}
}


import java.util.*;
public class plugin{
	public static void main(String[] args){
		Scanner br = new Scanner(System.in);
		String word = br.next();
		char[] chars = word.toCharArray();
		Stack<Character> st = new Stack<Character>();
		for(int i = 0;i<chars.length;i++){
			if(st.empty() || st.peek() != chars[i]){
				st.push(chars[i]);
			}
			else{
				st.pop();
			}
		}

		StringBuilder ans = new StringBuilder();
		while(!st.empty()){
			ans.append(st.pop());
		}
		ans.reverse();
		System.out.println(ans);
	}
}


import java.util.*;
public class plugin{
	public static void main(String[] args){
		Scanner br = new Scanner(System.in);
		String word = br.next();
		char[] chars = word.toCharArray();
		Stack<Character> st = new Stack<Character>();
		for(int i = 0;i<chars.length;i++){
			if(st.empty() || st.peek() != chars[i]){
				st.push(chars[i]);
			}
			else{
				st.pop();
			}
		}

		String ans = "";
		while(!st.empty()){
			ans = st.pop()+ans;
		}
		System.out.println(ans);
	}
}


import java.io.*;
import java.util.*;

public class Main
{
      static char arr[];
      static boolean marked[];
      static boolean ok;
      public static void main(String[] args)
     {
          PrintWriter pw=new PrintWriter(System.out);
          try
          {
                Parserdoubt pd=new Parserdoubt(System.in);
                arr=pd.nextString().toCharArray();
                marked=new boolean[arr.length];
                ok=true;
                while(ok)
                {
                    ok=false;
                    for(int i=0;i<arr.length;i++)
                    {
                        if(marked[i])continue;
                        for(int j=i+1;j<arr.length;j++)
                        {
                            if(!marked[j])
                            {
                                check(i,j);
                                break;
                            }
                        }
                    }
                }
                for(int i=0;i<marked.length;i++)
                    if(!marked[i])
                        System.out.print(arr[i]);
          }
        catch(Exception e)
        {
                e.printStackTrace();
          }
    }
     public static void check(int a,int b)
     {
        if(a<0||b==arr.length)return;
        if(arr[a]==arr[b])
        {ok=true;
            marked[a]=true;
            marked[b]=true;
            check(a-1,b+1);
        }
     }
     public static String transformed(String in)
     {
         String str="";
         int count=0;
         for(int i=0;i<in.length();i++)
         {
            if(in.charAt(i)==' ')
            {
                count=0;
                continue;
            }
            if(in.charAt(i)==',')
            {
                str+=", ";
                count=0;
            }
            else if(in.charAt(i)>='0'&&in.charAt(i)<='9')
            {
                str+=in.charAt(i);
                count=0;
            }
            else if(in.charAt(i)=='.')
            {
                if(count>0&&count<3)
                {
                    str+=in.charAt(i);
                    count++;
                    continue;
                }
                if(count==0)
                {
                    if(str.length()==0||str.charAt(str.length()-1)==' ')
                        str+=in.charAt(i);
                    else
                        str+=" .";
                    count++;
                }
                else
                {
                    str+=" .";
                    count=1;
                }
            }
         }
         return str;
     }
     }

 class Parserdoubt
    {
       final private int BUFFER_SIZE = 1 << 17;

       private DataInputStream din;
       private byte[] buffer;
       private int bufferPointer, bytesRead;

       public Parserdoubt(InputStream in)
       {
          din = new DataInputStream(in);
          buffer = new byte[BUFFER_SIZE];
          bufferPointer = bytesRead = 0;
       }
       public String nextString() throws Exception
       {
           StringBuffer sb=new StringBuffer("");
           byte c = read();
           while (c <= ' ') c = read();
           do
           {
               sb.append((char)c);
               c=read();
           }while(c>' ');
           return sb.toString();
       }
       public char nextChar() throws Exception
       {
           byte c=read();
           while(c<=' ') c= read();
           return (char)c;
       }
       public int nextInt() throws Exception
       {
          int ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       public long nextLong() throws Exception
       {
          long ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       private void fillBuffer() throws Exception
       {
          bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
          if (bytesRead == -1) buffer[0] = -1;
       }

       private byte read() throws Exception
       {
          if (bufferPointer == bytesRead) fillBuffer();
          return buffer[bufferPointer++];
       }
    }


import java.io.*;
import java.util.*;

public class Main
{
     public static String transform(String a)
     {
        if(a.length()==1)return a;
        String str="";
        for(int i=0;i<a.length()-1;i++)
            if(a.charAt(i)!=a.charAt(i+1))
                str+=a.charAt(i);
            else
                i++;
        if(a.length()>1&&a.charAt(a.length()-1)!=a.charAt(a.length()-2))
            str+=a.charAt(a.length()-1);
        return str;
     }
     public static void main(String[] args)
    {
          PrintWriter pw=new PrintWriter(System.out);
          try
          {
                Parserdoubt pd=new Parserdoubt(System.in);
                String in=pd.nextString();
                boolean ok=true;
                while(ok)
                {
                    ok=false;
                    String tmp=transform(in);
                    if(in.length()!=tmp.length())
                        ok=true;
                    in=tmp;
                }
                pw.println(in);
                pw.flush();
          }
        catch(Exception e)
        {
                e.printStackTrace();
          }
    }
     }

 class Parserdoubt
    {
       final private int BUFFER_SIZE = 1 << 17;

       private DataInputStream din;
       private byte[] buffer;
       private int bufferPointer, bytesRead;

       public Parserdoubt(InputStream in)
       {
          din = new DataInputStream(in);
          buffer = new byte[BUFFER_SIZE];
          bufferPointer = bytesRead = 0;
       }
       public String nextString() throws Exception
       {
           StringBuffer sb=new StringBuffer("");
           byte c = read();
           while (c <= ' ') c = read();
           do
           {
               sb.append((char)c);
               c=read();
           }while(c>' ');
           return sb.toString();
       }
       public char nextChar() throws Exception
       {
           byte c=read();
           while(c<=' ') c= read();
           return (char)c;
       }
       public int nextInt() throws Exception
       {
          int ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       public long nextLong() throws Exception
       {
          long ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       private void fillBuffer() throws Exception
       {
          bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
          if (bytesRead == -1) buffer[0] = -1;
       }

       private byte read() throws Exception
       {
          if (bufferPointer == bytesRead) fillBuffer();
          return buffer[bufferPointer++];
       }
    }


import java.io.*;
import java.util.*;

public class Main
{
      static char arr[];
      static boolean marked[];
      public static void main(String[] args)
     {
          PrintWriter pw=new PrintWriter(System.out);
          try
          {
                Parserdoubt pd=new Parserdoubt(System.in);
                arr=pd.nextString().toCharArray();
                marked=new boolean[arr.length];
                for(int i=0;i<arr.length;i++)
                {
                    if(marked[i])continue;
                    for(int j=i+1;j<arr.length;j++)
                    {
                        if(!marked[j])
                        {
                            check(i,j);
                            break;
                        }
                    }
                }
                for(int i=0;i<marked.length;i++)
                    if(!marked[i])
                        System.out.print(arr[i]);
          }
        catch(Exception e)
        {
                e.printStackTrace();
          }
    }
     public static void check(int a,int b)
     {
        if(a<0||b==arr.length)return;
        if(arr[a]==arr[b])
        {
            marked[a]=true;
            marked[b]=true;
            check(a-1,b+1);
        }
     }
     public static String transformed(String in)
     {
         String str="";
         int count=0;
         for(int i=0;i<in.length();i++)
         {
            if(in.charAt(i)==' ')
            {
                count=0;
                continue;
            }
            if(in.charAt(i)==',')
            {
                str+=", ";
                count=0;
            }
            else if(in.charAt(i)>='0'&&in.charAt(i)<='9')
            {
                str+=in.charAt(i);
                count=0;
            }
            else if(in.charAt(i)=='.')
            {
                if(count>0&&count<3)
                {
                    str+=in.charAt(i);
                    count++;
                    continue;
                }
                if(count==0)
                {
                    if(str.length()==0||str.charAt(str.length()-1)==' ')
                        str+=in.charAt(i);
                    else
                        str+=" .";
                    count++;
                }
                else
                {
                    str+=" .";
                    count=1;
                }
            }
         }
         return str;
     }
     }

 class Parserdoubt
    {
       final private int BUFFER_SIZE = 1 << 17;

       private DataInputStream din;
       private byte[] buffer;
       private int bufferPointer, bytesRead;

       public Parserdoubt(InputStream in)
       {
          din = new DataInputStream(in);
          buffer = new byte[BUFFER_SIZE];
          bufferPointer = bytesRead = 0;
       }
       public String nextString() throws Exception
       {
           StringBuffer sb=new StringBuffer("");
           byte c = read();
           while (c <= ' ') c = read();
           do
           {
               sb.append((char)c);
               c=read();
           }while(c>' ');
           return sb.toString();
       }
       public char nextChar() throws Exception
       {
           byte c=read();
           while(c<=' ') c= read();
           return (char)c;
       }
       public int nextInt() throws Exception
       {
          int ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       public long nextLong() throws Exception
       {
          long ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       private void fillBuffer() throws Exception
       {
          bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
          if (bytesRead == -1) buffer[0] = -1;
       }

       private byte read() throws Exception
       {
          if (bufferPointer == bytesRead) fillBuffer();
          return buffer[bufferPointer++];
       }
    }


import java.io.*;
import java.util.*;

public class Main
{
     public static String transform(String a)
     {
        if(a.length()==0)return null;
        if(a.length()==1)return a;
        String str="";
        boolean marked[]=new boolean[a.length()];
        for(int i=0;i<a.length()-1;i++)
            if(a.charAt(i)==a.charAt(i+1))
            {
                marked[i]=true;
                marked[i+1]=true;
                for(int j=0;j<a.length();j++)
                {
                    if(marked[j])continue;
                    str+=a.charAt(j);
                }
                return transform(str);
            }
        return a;
     }
     public static void main(String[] args)
    {
          PrintWriter pw=new PrintWriter(System.out);
          try
          {
                Parserdoubt pd=new Parserdoubt(System.in);
                String in=pd.nextString();

                in=transform(in);

                pw.println(in);
                pw.flush();
          }
        catch(Exception e)
        {
                e.printStackTrace();
          }
    }
     }

 class Parserdoubt
    {
       final private int BUFFER_SIZE = 1 << 17;

       private DataInputStream din;
       private byte[] buffer;
       private int bufferPointer, bytesRead;

       public Parserdoubt(InputStream in)
       {
          din = new DataInputStream(in);
          buffer = new byte[BUFFER_SIZE];
          bufferPointer = bytesRead = 0;
       }
       public String nextString() throws Exception
       {
           StringBuffer sb=new StringBuffer("");
           byte c = read();
           while (c <= ' ') c = read();
           do
           {
               sb.append((char)c);
               c=read();
           }while(c>' ');
           return sb.toString();
       }
       public char nextChar() throws Exception
       {
           byte c=read();
           while(c<=' ') c= read();
           return (char)c;
       }
       public int nextInt() throws Exception
       {
          int ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       public long nextLong() throws Exception
       {
          long ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       private void fillBuffer() throws Exception
       {
          bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
          if (bytesRead == -1) buffer[0] = -1;
       }

       private byte read() throws Exception
       {
          if (bufferPointer == bytesRead) fillBuffer();
          return buffer[bufferPointer++];
       }
    }


import java.util.*;
import java.io.*;

public class Main
{
      public static void main(String[] args)
     {
          PrintWriter pw=new PrintWriter(System.out);
          try
          {
                Parserdoubt pd=new Parserdoubt(System.in);
                String str=pd.nextString();
                Stack<Character> s=new Stack<Character>();
                for(int i=0;i<str.length();i++)
                {
                    char tmp=str.charAt(i);
                    if(s.size()==0)
                    {
                        s.push(tmp);
                    }
                    else
                    {
                        if(s.peek()==tmp)
                            s.pop();
                        else
                            s.push(tmp);
                    }
                }
                str="";
                while(s.size()>0)
                    str=s.pop()+str;
                System.out.println(str);

          }
        catch(Exception e)
        {
                e.printStackTrace();
          }
    }
 }

 class Parserdoubt
    {
       final private int BUFFER_SIZE = 1 << 17;

       private DataInputStream din;
       private byte[] buffer;
       private int bufferPointer, bytesRead;

       public Parserdoubt(InputStream in)
       {
          din = new DataInputStream(in);
          buffer = new byte[BUFFER_SIZE];
          bufferPointer = bytesRead = 0;
       }
       public String nextString() throws Exception
       {
           StringBuffer sb=new StringBuffer("");
           byte c = read();
           while (c <= ' ') c = read();
           do
           {
               sb.append((char)c);
               c=read();
           }while(c>' ');
           return sb.toString();
       }
       public char nextChar() throws Exception
       {
           byte c=read();
           while(c<=' ') c= read();
           return (char)c;
       }
       public int nextInt() throws Exception
       {
          int ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       public long nextLong() throws Exception
       {
          long ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       private void fillBuffer() throws Exception
       {
          bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
          if (bytesRead == -1) buffer[0] = -1;
       }

       private byte read() throws Exception
       {
          if (bufferPointer == bytesRead) fillBuffer();
          return buffer[bufferPointer++];
       }
    }


import java.util.*;
import java.io.*;

public class Main
{
      public static void main(String[] args)
     {
          PrintWriter pw=new PrintWriter(System.out);
          try
          {
                Parserdoubt pd=new Parserdoubt(System.in);
                String str=pd.nextString();
                Stack<Character> s=new Stack<Character>();
                for(int i=0;i<str.length();i++)
                {
                    char tmp=str.charAt(i);
                    if(s.size()==0)
                    {
                        s.push(tmp);
                    }
                    else
                    {
                        if(s.peek()==tmp)
                            s.pop();
                        else
                            s.push(tmp);
                    }
                }
                Stack<Character> print=new Stack<Character>();
                while(s.size()>0)
                    print.push(s.pop());
                while(print.size()>0)
                    System.out.print(print.pop());

          }
        catch(Exception e)
        {
                e.printStackTrace();
          }
    }
 }

 class Parserdoubt
    {
       final private int BUFFER_SIZE = 1 << 17;

       private DataInputStream din;
       private byte[] buffer;
       private int bufferPointer, bytesRead;

       public Parserdoubt(InputStream in)
       {
          din = new DataInputStream(in);
          buffer = new byte[BUFFER_SIZE];
          bufferPointer = bytesRead = 0;
       }
       public String nextString() throws Exception
       {
           StringBuffer sb=new StringBuffer("");
           byte c = read();
           while (c <= ' ') c = read();
           do
           {
               sb.append((char)c);
               c=read();
           }while(c>' ');
           return sb.toString();
       }
       public char nextChar() throws Exception
       {
           byte c=read();
           while(c<=' ') c= read();
           return (char)c;
       }
       public int nextInt() throws Exception
       {
          int ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       public long nextLong() throws Exception
       {
          long ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       private void fillBuffer() throws Exception
       {
          bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
          if (bytesRead == -1) buffer[0] = -1;
       }

       private byte read() throws Exception
       {
          if (bufferPointer == bytesRead) fillBuffer();
          return buffer[bufferPointer++];
       }
    }


import java.util.*;
import java.io.*;

public class Main
{
     public static void main(String[] args)
     {
          PrintWriter pw=new PrintWriter(System.out);
          try
          {
                Parserdoubt pd=new Parserdoubt(System.in);
                String str=pd.nextString();
                Stack<Character> s=new Stack<Character>();
                for(int i=0;i<str.length();i++)
                {
                    char tmp=str.charAt(i);
                    if(s.size()==0)
                    {
                        s.push(tmp);
                    }
                    else
                    {
                        if(s.peek()==tmp)
                            s.pop();
                        else
                            s.push(tmp);
                    }
                }
                Stack<Character> print=new Stack<Character>();
                while(s.size()>0)
                    print.push(s.pop());
                while(print.size()>0)
                    pw.print(print.pop());
                pw.flush();
          }
        catch(Exception e)
        {
                e.printStackTrace();
          }
    }
 }

 class Parserdoubt
    {
       final private int BUFFER_SIZE = 1 << 17;

       private DataInputStream din;
       private byte[] buffer;
       private int bufferPointer, bytesRead;

       public Parserdoubt(InputStream in)
       {
          din = new DataInputStream(in);
          buffer = new byte[BUFFER_SIZE];
          bufferPointer = bytesRead = 0;
       }
       public String nextString() throws Exception
       {
           StringBuffer sb=new StringBuffer("");
           byte c = read();
           while (c <= ' ') c = read();
           do
           {
               sb.append((char)c);
               c=read();
           }while(c>' ');
           return sb.toString();
       }
       public char nextChar() throws Exception
       {
           byte c=read();
           while(c<=' ') c= read();
           return (char)c;
       }
       public int nextInt() throws Exception
       {
          int ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       public long nextLong() throws Exception
       {
          long ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       private void fillBuffer() throws Exception
       {
          bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
          if (bytesRead == -1) buffer[0] = -1;
       }

       private byte read() throws Exception
       {
          if (bufferPointer == bytesRead) fillBuffer();
          return buffer[bufferPointer++];
       }
    }


import java.io.*;
import java.util.*;

public class Main
{
      static char arr[];
      static boolean marked[];
      static boolean ok;
      public static void main(String[] args)
     {
          PrintWriter pw=new PrintWriter(System.out);
          try
          {
                Parserdoubt pd=new Parserdoubt(System.in);
                arr=pd.nextString().toCharArray();
                marked=new boolean[arr.length];
                ok=true;
                while(ok)
                {
                    ok=false;
                    for(int i=0;i<arr.length;i++)
                    {
                        if(marked[i])continue;
                        for(int j=i+1;j<arr.length;j++)
                        {
                            if(!marked[j])
                            {
                                check(i,j);
                                break;
                            }
                        }
                    }
                }
                for(int i=0;i<marked.length;i++)
                    if(!marked[i])
                        System.out.print(arr[i]);
          }
        catch(Exception e)
        {
                e.printStackTrace();
          }
    }
     public static void check(int a,int b)
     {
        if(a<0||b==arr.length)return;
        if(arr[a]==arr[b]&&!marked[a]&&!marked[b])
        {ok=true;
            marked[a]=true;
            marked[b]=true;
            check(a-1,b+1);
        }
     }
     public static String transformed(String in)
     {
         String str="";
         int count=0;
         for(int i=0;i<in.length();i++)
         {
            if(in.charAt(i)==' ')
            {
                count=0;
                continue;
            }
            if(in.charAt(i)==',')
            {
                str+=", ";
                count=0;
            }
            else if(in.charAt(i)>='0'&&in.charAt(i)<='9')
            {
                str+=in.charAt(i);
                count=0;
            }
            else if(in.charAt(i)=='.')
            {
                if(count>0&&count<3)
                {
                    str+=in.charAt(i);
                    count++;
                    continue;
                }
                if(count==0)
                {
                    if(str.length()==0||str.charAt(str.length()-1)==' ')
                        str+=in.charAt(i);
                    else
                        str+=" .";
                    count++;
                }
                else
                {
                    str+=" .";
                    count=1;
                }
            }
         }
         return str;
     }
     }

 class Parserdoubt
    {
       final private int BUFFER_SIZE = 1 << 17;

       private DataInputStream din;
       private byte[] buffer;
       private int bufferPointer, bytesRead;

       public Parserdoubt(InputStream in)
       {
          din = new DataInputStream(in);
          buffer = new byte[BUFFER_SIZE];
          bufferPointer = bytesRead = 0;
       }
       public String nextString() throws Exception
       {
           StringBuffer sb=new StringBuffer("");
           byte c = read();
           while (c <= ' ') c = read();
           do
           {
               sb.append((char)c);
               c=read();
           }while(c>' ');
           return sb.toString();
       }
       public char nextChar() throws Exception
       {
           byte c=read();
           while(c<=' ') c= read();
           return (char)c;
       }
       public int nextInt() throws Exception
       {
          int ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       public long nextLong() throws Exception
       {
          long ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       private void fillBuffer() throws Exception
       {
          bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
          if (bytesRead == -1) buffer[0] = -1;
       }

       private byte read() throws Exception
       {
          if (bufferPointer == bytesRead) fillBuffer();
          return buffer[bufferPointer++];
       }
    }


import java.io.*;
import java.util.*;

public class Main
{
     public static String transform(String a)
     {
        if(a.length()==0)return null;
        if(a.length()==1)return a;
        String str="";
        for(int i=0;i<a.length()-1;i++)
            if(a.charAt(i)!=a.charAt(i+1))
                str+=a.charAt(i);
            else
                i++;
        if(a.charAt(a.length()-1)!=a.charAt(a.length()-2))
            str+=a.charAt(a.length()-1);
        return str;
     }
     public static void main(String[] args)
    {
          PrintWriter pw=new PrintWriter(System.out);
          try
          {
                Parserdoubt pd=new Parserdoubt(System.in);
                String in=pd.nextString();
                boolean ok=true;
                while(ok)
                {
                    ok=false;
                    String tmp=transform(in);
                    if(tmp!=null&&in.length()!=tmp.length())
                        ok=true;
                    in=tmp;
                }
                pw.println(in);
                pw.flush();
          }
        catch(Exception e)
        {
                e.printStackTrace();
          }
    }
     }

 class Parserdoubt
    {
       final private int BUFFER_SIZE = 1 << 17;

       private DataInputStream din;
       private byte[] buffer;
       private int bufferPointer, bytesRead;

       public Parserdoubt(InputStream in)
       {
          din = new DataInputStream(in);
          buffer = new byte[BUFFER_SIZE];
          bufferPointer = bytesRead = 0;
       }
       public String nextString() throws Exception
       {
           StringBuffer sb=new StringBuffer("");
           byte c = read();
           while (c <= ' ') c = read();
           do
           {
               sb.append((char)c);
               c=read();
           }while(c>' ');
           return sb.toString();
       }
       public char nextChar() throws Exception
       {
           byte c=read();
           while(c<=' ') c= read();
           return (char)c;
       }
       public int nextInt() throws Exception
       {
          int ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       public long nextLong() throws Exception
       {
          long ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       private void fillBuffer() throws Exception
       {
          bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
          if (bytesRead == -1) buffer[0] = -1;
       }

       private byte read() throws Exception
       {
          if (bufferPointer == bytesRead) fillBuffer();
          return buffer[bufferPointer++];
       }
    }


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class A {

    static BufferedReader in;
    static StringTokenizer st;

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        String s = next();
        int len = s.length();
        ArrayList<Character> ch = new ArrayList<Character>();
        for (int i = 0; i < len; i++) {
            ch.add(s.charAt(i));
        }
        for (int i = 1; i < ch.size(); i++) {
            if (ch.get(i) == ch.get(i - 1)) {
                ch.remove(i);
                ch.remove(i - 1);
                i -= 2;
                if (i < 0) {
                    i = 0;
                }
            }
        }
        for (int i = 0; i < ch.size(); i++) {
            System.out.print(ch.get(i));
        }
    }

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class A {

    static BufferedReader in;
    static StringTokenizer st;

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new BufferedWriter(
                new OutputStreamWriter(System.out)));
        String s = next();
        int len = s.length();
        ArrayList<Character> ch = new ArrayList<Character>();
        for (int i = 0; i < len; i++) {
            ch.add(s.charAt(i));
        }
        for (int i = 1; i < ch.size(); i++) {
            if (ch.get(i) == ch.get(i - 1)) {
                ch.remove(i);
                ch.remove(i - 1);
                i -= 2;
                if (i < 0) {
                    i = 0;
                }
            }
        }
        for (int i = 0; i < ch.size(); i++) {
            out.print(ch.get(i));
        }
        out.close();
    }

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class A {

    static BufferedReader in;
    static StringTokenizer st;

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        // in = new BufferedReader(new FileReader(new File("input.txt")));
        PrintWriter out = new PrintWriter(new BufferedWriter(
                new OutputStreamWriter(System.out)));
        ArrayList<Character> ch = new ArrayList<Character>();
        while (in.ready()) {
            char tmp = (char) in.read();
            if (tmp != 10 && tmp != 13) {
                if (!ch.isEmpty() && tmp != ch.get(ch.size() - 1)
                        || ch.isEmpty()) {
                    ch.add(tmp);
                } else {
                    ch.remove(ch.size() - 1);
                }
            }
        }
        for (int i = 0; i < ch.size(); i++) {
            out.print(ch.get(i));
        }
        out.close();
    }

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class A {

    static BufferedReader in;
    static StringTokenizer st;

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        // in = new BufferedReader(new FileReader(new File("input.txt")));
        PrintWriter out = new PrintWriter(new BufferedWriter(
                new OutputStreamWriter(System.out)));
        ArrayList<Character> ch = new ArrayList<Character>();
        while (in.ready()) {
            char tmp = (char) in.read();
            if (tmp != 10 && tmp != 13) {
                ch.add(tmp);
            }
        }
        for (int i = 1; i < ch.size(); i++) {
            if (ch.get(i) == ch.get(i - 1)) {
                ch.remove(i);
                ch.remove(i - 1);
                i -= 2;
                if (i < 0) {
                    i = 0;
                }
            }
        }
        for (int i = 0; i < ch.size(); i++) {
            out.print(ch.get(i));
        }
        out.close();
    }

}


import java.io.*;
import java.util.*;

public class A {
  public static void main(String args[]) {
    new A();
  }
  public A() {
    Scanner in = new Scanner(System.in);

    String line = in.nextLine();
    String ans = "";

    Stack<Character> stack = new Stack<Character>();
    for(int i = 0; i < line.length(); i++) {
      if(stack.size() > 0) {
        if(stack.peek() == line.charAt(i)) {
          stack.pop();
        } else {
          stack.push(line.charAt(i));
        }
      } else {
        stack.push(line.charAt(i));
      }
    }
    while(stack.size() > 0) {
      ans = stack.pop() + ans;
    }
    System.out.println(ans);
  }

}


import java.io.*;
import java.util.*;

public class A {
  public static void main(String args[]) {
    new A();
  }
  public A() {
    Scanner in = new Scanner(System.in);

    String line = in.nextLine();
    String next = "";
    boolean repeat = true;
    while(repeat) {
      repeat = false;
      next = "";
      for(int i = 0; i < line.length(); i++) {
        if(i+1 < line.length() && line.charAt(i) == line.charAt(i+1)) {
          i++;
          repeat = true;
        } else {
          next += line.charAt(i);
        }
      }
      line = next;
    }
    System.out.println(line);
  }

}


import java.io.*;
import java.util.*;

public class A {
  public static void main(String args[]) {
    new A();
  }
  public A() {
    Scanner in = new Scanner(System.in);

    String line = in.nextLine();
    String ans = "";

    Stack<Character> stack = new Stack<Character>();
    for(int i = 0; i < line.length(); i++) {
      if(stack.size() > 0) {
        if(stack.peek() == line.charAt(i)) {
          stack.pop();
        } else {
          stack.push(line.charAt(i));
        }
      } else {
        stack.push(line.charAt(i));
      }
    }
    System.out.println(stack.toString().replaceAll("\\[", "").replaceAll("\\]", "").replaceAll(",", ""));
  }

}


import java.io.*;
import java.util.*;

public class A {
  public static void main(String args[]) {
    new A();
  }
  public A() {
    Scanner in = new Scanner(System.in);

    String line = in.nextLine();
    StringBuilder ans = new StringBuilder();

    Stack<Character> stack = new Stack<Character>();
    for(int i = 0; i < line.length(); i++) {
      if(stack.size() > 0) {
        if(stack.peek() == line.charAt(i)) {
          stack.pop();
        } else {
          stack.push(line.charAt(i));
        }
      } else {
        stack.push(line.charAt(i));
      }
    }
    while(stack.size() > 0) {
      ans.append(stack.pop());
    }
    System.out.println(ans.reverse().toString());
  }

}


import java.io.*;
import java.util.*;
public class Code {

    StreamTokenizer in;
    BufferedReader inb;
    StringTokenizer ins;
    PrintWriter out;

    public static void main(String[] args) throws Exception {
        new Code().run();
    }

    public void run() throws Exception {
        in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        inb = new BufferedReader(new InputStreamReader(System.in));
        ins = new StringTokenizer("");
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solve();
        out.flush();
    }

    public int nextInt() throws Exception {
        in.nextToken();
        return (int) in.nval;
    }

    public String nextLine() throws Exception {
        return inb.readLine();
    }

    public String nextStr() throws Exception {
        while (!ins.hasMoreTokens())
            ins = new StringTokenizer(inb.readLine());
        return ins.nextToken();
    }

    public Long parseLong() throws Exception {
        return Long.parseLong(nextStr());
    }

    public int parseInt() throws Exception {
        return Integer.parseInt(nextStr());
    }

    public String resultStr(Stack st) throws Exception {
        String t = "";
        for (int i=st.size()-1;i>=0;i--)
            t += st.get(i);
        return t;
    }

    public void solve() throws Exception {
        String s = nextLine();
        Stack <Character> st = new Stack <Character>();
        st.add(s.charAt(0));
        for (int i=1;i<s.length();i++) {
            if ((!st.isEmpty()) && (st.peek()==s.charAt(i)))
                st.pop();
            else st.add(s.charAt(i));
        }
        String t = resultStr(st);
        out.print(t);
    }
}


import java.io.*;
import java.util.*;
public class Code {

    StreamTokenizer in;
    BufferedReader inb;
    StringTokenizer ins;
    PrintWriter out;

    public static void main(String[] args) throws Exception {
        new Code().run();
    }

    public void run() throws Exception {
        in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        inb = new BufferedReader(new InputStreamReader(System.in));
        ins = new StringTokenizer("");
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solve();
        out.flush();
    }

    public int nextInt() throws Exception {
        in.nextToken();
        return (int) in.nval;
    }

    public String nextLine() throws Exception {
        return inb.readLine();
    }

    public String nextStr() throws Exception {
        while (!ins.hasMoreTokens())
            ins = new StringTokenizer(inb.readLine());
        return ins.nextToken();
    }

    public Long parseLong() throws Exception {
        return Long.parseLong(nextStr());
    }

    public int parseInt() throws Exception {
        return Integer.parseInt(nextStr());
    }

    public String resultStr(LinkedList list) throws Exception {
        String t = "";
        for (int i=list.size()-1;i>=0;i--)
            t += list.get(i);
        return t;
    }

    public void solve() throws Exception {
        String s = nextLine();
        LinkedList <Character> list = new LinkedList <Character>();
        list.addFirst(s.charAt(0));
        for (int i=1;i<s.length();i++) {
            if ((!list.isEmpty()) && (list.getFirst()==s.charAt(i)))
                list.removeFirst();
            else list.addFirst(s.charAt(i));
        }
        String t = resultStr(list);
        out.print(t);
    }
}


import java.io.*;
import java.util.*;
public class Code {

    StreamTokenizer in;
    BufferedReader inb;
    StringTokenizer ins;
    PrintWriter out;

    public static void main(String[] args) throws Exception {
        new Code().run();
    }

    public void run() throws Exception {
        in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        inb = new BufferedReader(new InputStreamReader(System.in));
        ins = new StringTokenizer("");
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solve();
        out.flush();
    }

    public int nextInt() throws Exception {
        in.nextToken();
        return (int) in.nval;
    }

    public String nextLine() throws Exception {
        return inb.readLine();
    }

    public String nextStr() throws Exception {
        while (!ins.hasMoreTokens())
            ins = new StringTokenizer(inb.readLine());
        return ins.nextToken();
    }

    public Long parseLong() throws Exception {
        return Long.parseLong(nextStr());
    }

    public int parseInt() throws Exception {
        return Integer.parseInt(nextStr());
    }

    public String resultStr(LinkedList list) throws Exception {
        String t = "";
        for (int i=list.size()-1;i>=0;i--)
            t += list.get(i);
        return t;
    }

    public void solve() throws Exception {
        String s = nextLine();
        LinkedList <Character> list = new LinkedList <Character>();
        list.addFirst(s.charAt(0));
        for (int i=1;i<s.length();i++) {
            if ((!list.isEmpty()) && (list.getFirst()==s.charAt(i)))
                list.removeFirst();
            else list.addFirst(s.charAt(i));
        }
        for (int i=list.size()-1;i>=0;i--)
            out.print(list.get(i));
    }
}


import java.io.*;
import java.util.*;
public class Code {

    StreamTokenizer in;
    BufferedReader inb;
    StringTokenizer ins;
    PrintWriter out;

    public static void main(String[] args) throws Exception {
        new Code().run();
    }

    public void run() throws Exception {
        in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        inb = new BufferedReader(new InputStreamReader(System.in));
        ins = new StringTokenizer("");
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solve();
        out.flush();
    }

    public int nextInt() throws Exception {
        in.nextToken();
        return (int) in.nval;
    }

    public String nextLine() throws Exception {
        return inb.readLine();
    }

    public String nextStr() throws Exception {
        while (!ins.hasMoreTokens())
            ins = new StringTokenizer(inb.readLine());
        return ins.nextToken();
    }

    public Long parseLong() throws Exception {
        return Long.parseLong(nextStr());
    }

    public int parseInt() throws Exception {
        return Integer.parseInt(nextStr());
    }

    public void solve() throws Exception {
        String s = nextLine();
        Stack <Character> list = new Stack <Character>();
        list.push(s.charAt(0));
        for (int i=1;i<s.length();i++) {
            if ((!list.isEmpty()) && (list.peek()==s.charAt(i)))
                list.pop();
            else list.push(s.charAt(i));
        }
        for (int i=0;i<list.size();i++)
            out.print(list.get(i));
    }
}


import java.io.*;
import java.util.*;
public class Code {

    StreamTokenizer in;
    BufferedReader inb;
    StringTokenizer ins;
    PrintWriter out;

    public static void main(String[] args) throws Exception {
        new Code().run();
    }

    public void run() throws Exception {
        in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        inb = new BufferedReader(new InputStreamReader(System.in));
        ins = new StringTokenizer("");
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solve();
        out.flush();
    }

    public int nextInt() throws Exception {
        in.nextToken();
        return (int) in.nval;
    }

    public String nextLine() throws Exception {
        return inb.readLine();
    }

    public String nextStr() throws Exception {
        while (!ins.hasMoreTokens())
            ins = new StringTokenizer(inb.readLine());
        return ins.nextToken();
    }

    public Long parseLong() throws Exception {
        return Long.parseLong(nextStr());
    }

    public int parseInt() throws Exception {
        return Integer.parseInt(nextStr());
    }

    public String resultStr(LinkedList list) throws Exception {
        String t = "";
        for (int i=list.size()-1;i>=0;i--)
            t += list.remove(i);
        return t;
    }

    public void solve() throws Exception {
        String s = nextLine();
        LinkedList <Character> list = new LinkedList <Character>();
        list.addFirst(s.charAt(0));
        for (int i=1;i<s.length();i++) {
            if ((!list.isEmpty()) && (list.getFirst()==s.charAt(i)))
                list.removeFirst();
            else list.addFirst(s.charAt(i));
        }
        String t = resultStr(list);
        out.print(t);
    }
}


import java.io.*;
import java.util.*;
public class Code2 {

    StreamTokenizer in;
    BufferedReader inb;
    StringTokenizer ins;
    PrintWriter out;

    public static void main(String[] args) throws Exception {
        new Code2().run();
    }

    public void run() throws Exception {
        in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        inb = new BufferedReader(new InputStreamReader(System.in));
        ins = new StringTokenizer("");
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solve();
        out.flush();
    }

    public int nextInt() throws Exception {
        in.nextToken();
        return (int) in.nval;
    }

    public String nextLine() throws Exception {
        return inb.readLine();
    }

    public String nextStr() throws Exception {
        while (!ins.hasMoreTokens())
            ins = new StringTokenizer(inb.readLine());
        return ins.nextToken();
    }

    public LinkedList parseStr(String s) throws Exception {
        LinkedList <Character> list = new LinkedList <Character>();
        for (int i=0;i<s.length();i++)
            list.addLast(s.charAt(i));
        return list;
    }

    public String result(LinkedList list) throws Exception {
        String t="";
        for (int i=0;i<list.size();i++)
            t +=list.remove(i);
        return t;
    }

    public void solve() throws Exception {
        String s = nextLine();
        int i=0;
        LinkedList <Character> list = new LinkedList <Character>();
        list = parseStr(s);
        do {
            if (list.get(i) == list.get(i+1)) {
                list.remove(list.get(i));
                list.remove(list.get(i+1));
            }
        } while (i<list.size()-1);
        //out.println(list);
        String t = "";
        t = result(list);
    }
}


import java.io.*;
import java.util.LinkedList;
import java.util.Stack;

public class Main {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

		String s = in.readLine();

		String res = s.replaceAll("(\\w)\\1+", "");

		out.write(res);

		out.flush();
	}

}


import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Stack;

public class Main {

	private static BufferedReader input; // ���� ����� ����� ������ ���������
											// ������ �� ������-���� ������
	private static PrintWriter output; // ���� ����� ����� ������ ������ ������
	private static StreamTokenizer stoken; // ���� ����� ������ ����� ���������
											// ���������� �������. �� ���������
											// ����������� - ������

	static String fin = "input";
	static String fout = "output";

	private static void solve() throws IOException {
		String temp = input.readLine();
		while(temp.matches(".*([a-z])\\1+.*")){
			temp = temp.replaceAll("(.)\\1", "");
		}
		output.print(temp);
	}

	public static void main(String[] args) throws IOException {
		// �������� ������
		input = new BufferedReader(new InputStreamReader(System.in));
		output = new PrintWriter(System.out);

		// �������� ������
		// input = new BufferedReader(new FileReader(fin + ".txt"));
		// output = new PrintWriter(new FileWriter(fout + ".txt"));

		stoken = new StreamTokenizer(input);

		// ����� �������
		solve();

		// �������� �����
		input.close();
		// ����� ������
		output.flush();
		// �������� �����
		output.close();
	}

	// ��������� 32-������ ����� �����
	private static int nextInt() throws IOException {
		return (int) nextDouble();
	}

	// ��������� 64-������ ����� �����
	private static long nextLong() throws IOException {
		return (long) nextDouble();
	}

	// ��������� 64-������ ������� �����
	private static double nextDouble() throws IOException {
		stoken.nextToken();
		return stoken.nval;
	}

}


import java.io.*;
import java.util.LinkedList;
import java.util.Stack;

public class Main {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

		String s = in.readLine();

		LinkedList<String> temp = new LinkedList<String>();

		int n = s.length();
		for (int i = 0 ; i < n; i++ ){
			String temps = String.valueOf(s.charAt(i));
			if ( temp.indexOf(temps) == -1 ){
				temp.add(temps);
			}else{
				temp.remove(temps);
			}
		}

		n = temp.size();
		for (int i = 0; i < n; i++){
			out.write(temp.get(i));
		}

		out.flush();
	}

}


import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Stack;

public class Main {

	private static BufferedReader input; // ���� ����� ����� ������ ���������
											// ������ �� ������-���� ������
	private static PrintWriter output; // ���� ����� ����� ������ ������ ������
	private static StreamTokenizer stoken; // ���� ����� ������ ����� ���������
											// ���������� �������. �� ���������
											// ����������� - ������

	static String fin = "input";
	static String fout = "output";

	private static void solve() throws IOException {
		String temp = input.readLine();
		while(temp.matches(".*(.)\\1+.*")){
			temp = temp.replaceAll("(.)\\1", "");
		}
		output.print(temp);
	}

	public static void main(String[] args) throws IOException {
		// �������� ������
		input = new BufferedReader(new InputStreamReader(System.in));
		output = new PrintWriter(System.out);

		// �������� ������
		// input = new BufferedReader(new FileReader(fin + ".txt"));
		// output = new PrintWriter(new FileWriter(fout + ".txt"));

		stoken = new StreamTokenizer(input);

		// ����� �������
		solve();

		// �������� �����
		input.close();
		// ����� ������
		output.flush();
		// �������� �����
		output.close();
	}

	// ��������� 32-������ ����� �����
	private static int nextInt() throws IOException {
		return (int) nextDouble();
	}

	// ��������� 64-������ ����� �����
	private static long nextLong() throws IOException {
		return (long) nextDouble();
	}

	// ��������� 64-������ ������� �����
	private static double nextDouble() throws IOException {
		stoken.nextToken();
		return stoken.nval;
	}

}


#include <iostream>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <queue>
#include <string>
#include <stack>
#include <ctime>

using namespace std;

#define all(x) (x).begin(), (x).end()
#define For(i,n) for(ll i = 0; i < (n); i++)
#define ld long double
#define ll long long

ld const PI = 3.14159265358979323;
ll mod = 1000000007;

ll binpow (ll a, ll n) {
    if (n == 0)
        return 1;
    if (n % 2 == 1)
        return (binpow (a, n-1) * a);
    else {
        ll b = binpow (a, n/2);
        return (b * b);
    }
}

vector<ll> zf (string s) {
    ll n = (ll) s.length();
    vector<ll> z (n);
    for (ll i=1, l=0, r=0; i<n; ++i) {
        if (i <= r)
            z[i] = min (r-i+1, z[i-l]);
        while (i+z[i] < n && s[z[i]] == s[i+z[i]])
            ++z[i];
        if (i+z[i]-1 > r)
            l = i,  r = i+z[i]-1;
    }
    return z;
}

int norm(string s)
{
    if(s.size() == 1) {
        if(s[0] == '0') {return -1;}
    }
    if(s[0]!= '1') return 0;
    for(int i =1; i < s.size(); i++) {
        if(s[i]!='0') return 0;
    }
    return 1;
}

int main()
{
#ifdef _DEBUG
    freopen("input.txt","rt",stdin);
    freopen("output.txt","wt",stdout);
    //#else
    //freopen("a.in","rt",stdin);
    //freopen("a.out","wt",stdout);
#endif

    ios_base::sync_with_stdio(0);

    int n;
    cin >> n;
    string ans = "",s;
    For(i,n) {
        cin >> s;
        int d = norm(s);
        if(d>0) {
            s.erase(0,1);
            ans = ans+s;
        }
        else{
            if(d==-1) {cout<< 0; return 0;}
            else ans = s + ans;
        }
    }
    if(ans[0]=='0') ans = "1" + ans;
    if(ans.size() == 0) ans = "1" + ans;
    cout << ans;
    return 0;
}


#include <iostream>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <queue>
#include <string>
#include <stack>
#include <ctime>

using namespace std;

#define all(x) (x).begin(), (x).end()
#define For(i,n) for(ll i = 0; i < (n); i++)
#define ld long double
#define ll long long

ld const PI = 3.14159265358979323;
ll mod = 1000000007;

ll binpow (ll a, ll n) {
    if (n == 0)
        return 1;
    if (n % 2 == 1)
        return (binpow (a, n-1) * a);
    else {
        ll b = binpow (a, n/2);
        return (b * b);
    }
}

vector<ll> zf (string s) {
    ll n = (ll) s.length();
    vector<ll> z (n);
    for (ll i=1, l=0, r=0; i<n; ++i) {
        if (i <= r)
            z[i] = min (r-i+1, z[i-l]);
        while (i+z[i] < n && s[z[i]] == s[i+z[i]])
            ++z[i];
        if (i+z[i]-1 > r)
            l = i,  r = i+z[i]-1;
    }
    return z;
}

int norm(string s)
{
    if(s.size() == 1) {
        if(s[0] == '0') {return -1;}
    }
    if(s[0]!= '1') return 0;
    for(int i =1; i < s.size(); i++) {
        if(s[i]!='0') return 0;
    }
    return 1;
}

int main()
{
#ifdef _DEBUG
    freopen("input.txt","rt",stdin);
    freopen("output.txt","wt",stdout);
    //#else
    //freopen("a.in","rt",stdin);
    //freopen("a.out","wt",stdout);
#endif

    ios_base::sync_with_stdio(0);

    int n;
    cin >> n;
    string ans = "",s;
    For(i,n) {
        cin >> s;
        int d = norm(s);
        if(d>0) {
            s.erase(0,1);
            ans = ans+s;
        }
        else{
            if(d==-1) {cout<< 0; return 0;}
            else ans = s + ans;
        }
    }
    cout << ans;
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define MAXN 10001
#define mod 10000
char ch[2*MAXN];
struct bign
{
      int size;
      int n[MAXN];
      void reset()
      {
            memset(n,0,sizeof(n));
            size=0;
      }
      void in()
      {
      	    int len=0;
            while(true)
            {
            	 char chuse=getchar();
            	 if('0'<=chuse && chuse<='9')
            	       ch[++len]=chuse;
            	 else break;
			}
            size=(len+3)/4;
            int now=len-(size-1)*4;
            for(int i=1;i<=now;i++)
                  n[size]=n[size]*10+ch[i]-'0';
            for(int i=size-1;i>=1;i--)
                  for(int j=1;j<=4;j++)
                        n[i]=n[i]*10+ch[++now]-'0';
      }
      void out()
      {
            printf("%d",n[size]);
            for(int i=size-1;i>=1;i--)
                  printf("%04d",n[i]);
      }
      friend bign operator * (bign x,bign y)
      {
            bign ans;
            memset(ans.n,0,sizeof(ans.n));
            ans.size=x.size+y.size;
            for(int i=1;i<=x.size;i++)
                  for(int j=1;j<=y.size;j++)
                        ans.n[i+j-1]+=x.n[i]*y.n[j];
            for(int i=1;i<=ans.size;i++)
            {
                  if(ans.n[i]>=mod && i==ans.size)   ans.size++;
                  ans.n[i+1]+=ans.n[i]/mod;
                  ans.n[i]%=mod;
            }
            while(!ans.n[ans.size] && ans.size!=1)
                  ans.size--;
            return ans;
      }
}ans,number;
int N;
int main()
{
#ifndef ONLINE_JUDGE
      freopen("input.txt","r",stdin);
      freopen("output.txt","w",stdout);
#endif
	scanf("%d",&N);
	getchar();
	ans.reset();
	ans.size=1;
	ans.n[1]=1;
	for(int i=1;i<=N;i++)
	{
		  number.reset();
		  number.in();
		  int one=0;bool other=false;
		  for(int j=1;j<=number.size;j++)
		  {
		        if(number.n[j]==1)
		              one++;
		        if(number.n[j]!=1 && number.n[j]!=0)
		              other=true;
		        if(other || one>=2)
		              break;
		  }
		  if(!other || one<=1)
		        ans=ans*number;
	}
	ans.out();
	printf("\n");
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
#define MAXN 100001
string ch;
int N,zeronum=0;
bool output=false;
int main()
{
#ifndef ONLINE_JUDGE
      freopen("input.txt","r",stdin);
      freopen("output.txt","w",stdout);
#endif
	scanf("%d",&N);
	for(int i=1;i<=N;i++)
	{
		  cin>>ch;
		  int len=ch.size();
		  if(len==1 && ch[0]=='0')
		  {
		  	    printf("0\n");
		  	    return 0;
		  }
		  int nowzeronum=0;
		  for(int j=len-1;j>=0;j--)
		        nowzeronum+=(ch[j]=='0');
		  zeronum+=nowzeronum;
		  if(!output && !(nowzeronum==len-1 && ch[0]=='1'))
		  {
		  	    cout<<ch;
		  	    output=true;
		  	    zeronum-=nowzeronum;
		  }
	}
	if(!output)   printf("1");
	for(int i=1;i<=zeronum;i++)
	      printf("0");
	printf("\n");
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define MAXN 100001
string ch;
int N,zeronum=0;
bool output=false;
int main()
{
#ifndef ONLINE_JUDGE
      freopen("input.txt","r",stdin);
      freopen("output.txt","w",stdout);
#endif
	scanf("%d",&N);
	for(int i=1;i<=N;i++)
	{
		  cin>>ch;
		  int len=ch.size();
		  if(len==1 && ch[0]=='0')
		  {
		  	    printf("0\n");
		  	    return 0;
		  }
		  int nowzeronum=0;
		  for(int j=len-1;j>=0;j--)
		        nowzeronum+=(ch[j]=='0');
		  zeronum+=nowzeronum;
		  if(!output && !(nowzeronum==len-1 && ch[0]=='1'))
		  {
		  	    cout<<ch;
		  	    output=true;
		  	    zeronum-=nowzeronum;
		  }
	}
	if(!output)   printf("1");
	for(int i=1;i<=zeronum;i++)
	      printf("0");
	printf("\n");
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define MAXN 20001
#define mod 10000
char ch[2*MAXN];
struct bign
{
      int size;
      int n[MAXN];
      void in()
      {
      	    int len=0;
            while(true)
            {
            	 char chuse=getchar();
            	 if('0'<=chuse && chuse<='9')
            	       ch[++len]=chuse;
            	 else break;
			}
            size=(len+3)/4;
            int now=len-(size-1)*4;
            n[size]=0;
            for(int i=1;i<=now;i++)
                  n[size]=n[size]*10+ch[i]-'0';
            for(int i=size-1;i>=1;i--)
            {
            	  n[i]=0;
                  for(int j=1;j<=4;j++)
                        n[i]=n[i]*10+ch[++now]-'0';
            }
      }
      void out()
      {
            printf("%d",n[size]);
            for(int i=size-1;i>=1;i--)
                  printf("%04d",n[i]);
      }
      friend bign operator * (bign x,bign y)
      {
            bign ans;
            memset(ans.n,0,sizeof(ans.n));
            ans.size=x.size+y.size;
            for(int i=1;i<=x.size;i++)
                  for(int j=1;j<=y.size;j++)
                        ans.n[i+j-1]+=x.n[i]*y.n[j];
            for(int i=1;i<=ans.size;i++)
            {
                  if(ans.n[i]>=mod && i==ans.size)   ans.size++;
                  ans.n[i+1]+=ans.n[i]/mod;
                  ans.n[i]%=mod;
            }
            while(!ans.n[ans.size] && ans.size!=1)
                  ans.size--;
            return ans;
      }
}ans,number;
int N;
int main()
{
#ifndef ONLINE_JUDGE
      freopen("input.txt","r",stdin);
      freopen("output.txt","w",stdout);
#endif
	scanf("%d",&N);
	getchar();
	ans.size=1;
	ans.n[1]=1;
	for(int i=1;i<=N;i++)
	{
		  number.in();
		  int one=0;bool other=false;
		  for(int j=1;j<=number.size;j++)
		  {
		        if(number.n[j]==1)
		              one++;
		        if(number.n[j]!=1 && number.n[j]!=0)
		              other=true;
		        if(other || one>=2)
		              break;
		  }
		  if(!other || one<=1)
		        ans=ans*number;
	}
	ans.out();
	printf("\n");
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define MAXN 50001
#define mod 10000
char ch[2*MAXN];
const int prime[25+1]={0,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
struct bign
{
      int size;
      long long n[MAXN];
      void reset()
      {
            memset(n,0,sizeof(n));
            size=0;
      }
      void in()
      {
      	    int len=0;
            while(true)
            {
            	 char chuse=getchar();
            	 if('0'<=chuse && chuse<='9')
            	       ch[++len]=chuse;
			}
            size=(len+3)/4;
            int now=len-(size-1)*4;
            for(int i=1;i<=now;i++)
                  n[size]=n[size]*10+ch[i]-'0';
            for(int i=size-1;i>=1;i--)
                  for(int j=1;j<=4;j++)
                        n[i]=n[i]*10+ch[++now]-'0';
      }
      void out()
      {
            printf("%d",n[size]);
            for(int i=size-1;i>=1;i--)
                  printf("%04d",n[i]);
      }
      friend bign operator * (bign x,bign y)
      {
            bign ans;
            memset(ans.n,0,sizeof(ans.n));
            ans.size=x.size+y.size;
            for(int i=1;i<=x.size;i++)
                  for(int j=1;j<=y.size;j++)
                        ans.n[i+j-1]+=x.n[i]*y.n[j];
            for(int i=1;i<=ans.size;i++)
            {
                  if(ans.n[i]>=mod && i==ans.size)   ans.size++;
                  ans.n[i+1]+=ans.n[i]/mod;
                  ans.n[i]%=mod;
            }
            while(!ans.n[ans.size] && ans.size!=1)
                  ans.size--;
            return ans;
      }
}ans;
int N;
int main()
{
#ifndef ONLINE_JUDGE
      freopen("input.txt","r",stdin);
      freopen("output.txt","w",stdout);
#endif
	scanf("%d\n",&N);
	ans.reset();
	ans.size=1;
	ans.n[1]=1;
	for(int i=1;i<=N;i++)
	{
		  bign number;
		  number.in();
		  int one=0;bool other=false;
		  for(int j=1;j<=number.size;j++)
		  {
		        if(number.n[j]==1)
		              one++;
		        if(number.n[j]!=1 && number.n[j]!=0)
		              other=true;
		        if(other || one>=2)
		              break;
		  }
		  if(!other || one<=1)
		        ans=ans*number;
	}
	ans.out();
	printf("\n");
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define MAXN 20001
#define mod 10000
char ch[2*MAXN];
struct bign
{
      int size;
      long long n[MAXN];
      void reset()
      {
            memset(n,0,sizeof(n));
            size=0;
      }
      void in()
      {
      	    int len=0;
            while(true)
            {
            	 char chuse=getchar();
            	 if('0'<=chuse && chuse<='9')
            	       ch[++len]=chuse;
            	 else break;
			}
            size=(len+3)/4;
            int now=len-(size-1)*4;
            for(int i=1;i<=now;i++)
                  n[size]=n[size]*10+ch[i]-'0';
            for(int i=size-1;i>=1;i--)
                  for(int j=1;j<=4;j++)
                        n[i]=n[i]*10+ch[++now]-'0';
      }
      void out()
      {
            printf("%d",n[size]);
            for(int i=size-1;i>=1;i--)
                  printf("%04d",n[i]);
      }
      friend bign operator * (bign x,bign y)
      {
            bign ans;
            memset(ans.n,0,sizeof(ans.n));
            ans.size=x.size+y.size;
            for(int i=1;i<=x.size;i++)
                  for(int j=1;j<=y.size;j++)
                        ans.n[i+j-1]+=x.n[i]*y.n[j];
            for(int i=1;i<=ans.size;i++)
            {
                  if(ans.n[i]>=mod && i==ans.size)   ans.size++;
                  ans.n[i+1]+=ans.n[i]/mod;
                  ans.n[i]%=mod;
            }
            while(!ans.n[ans.size] && ans.size!=1)
                  ans.size--;
            return ans;
      }
}ans,number;
int N;
int main()
{
#ifndef ONLINE_JUDGE
      freopen("input.txt","r",stdin);
      freopen("output.txt","w",stdout);
#endif
	scanf("%d",&N);
	getchar();
	ans.reset();
	ans.size=1;
	ans.n[1]=1;
	for(int i=1;i<=N;i++)
	{
		  number.reset();
		  number.in();
		  int one=0;bool other=false;
		  for(int j=1;j<=number.size;j++)
		  {
		        if(number.n[j]==1)
		              one++;
		        if(number.n[j]!=1 && number.n[j]!=0)
		              other=true;
		        if(other || one>=2)
		              break;
		  }
		  if(!other || one<=1)
		        ans=ans*number;
	}
	ans.out();
	printf("\n");
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define MAXN 50001
#define mod 10000
char ch[2*MAXN];
struct bign
{
      int size;
      long long n[MAXN];
      void reset()
      {
            memset(n,0,sizeof(n));
            size=0;
      }
      void in()
      {
      	    int len=0;
            while(true)
            {
            	 char chuse=getchar();
            	 if('0'<=chuse && chuse<='9')
            	       ch[++len]=chuse;
            	 else break;
			}
            size=(len+3)/4;
            int now=len-(size-1)*4;
            for(int i=1;i<=now;i++)
                  n[size]=n[size]*10+ch[i]-'0';
            for(int i=size-1;i>=1;i--)
                  for(int j=1;j<=4;j++)
                        n[i]=n[i]*10+ch[++now]-'0';
      }
      void out()
      {
            printf("%d",n[size]);
            for(int i=size-1;i>=1;i--)
                  printf("%04d",n[i]);
      }
      friend bign operator * (bign x,bign y)
      {
            bign ans;
            memset(ans.n,0,sizeof(ans.n));
            ans.size=x.size+y.size;
            for(int i=1;i<=x.size;i++)
                  for(int j=1;j<=y.size;j++)
                        ans.n[i+j-1]+=x.n[i]*y.n[j];
            for(int i=1;i<=ans.size;i++)
            {
                  if(ans.n[i]>=mod && i==ans.size)   ans.size++;
                  ans.n[i+1]+=ans.n[i]/mod;
                  ans.n[i]%=mod;
            }
            while(!ans.n[ans.size] && ans.size!=1)
                  ans.size--;
            return ans;
      }
}ans,number;
int N;
int main()
{
#ifndef ONLINE_JUDGE
      freopen("input.txt","r",stdin);
      freopen("output.txt","w",stdout);
#endif
	scanf("%d",&N);
	getchar();
	ans.reset();
	ans.size=1;
	ans.n[1]=1;
	for(int i=1;i<=N;i++)
	{
		  number.reset();
		  number.in();
		  int one=0;bool other=false;
		  for(int j=1;j<=number.size;j++)
		  {
		        if(number.n[j]==1)
		              one++;
		        if(number.n[j]!=1 && number.n[j]!=0)
		              other=true;
		        if(other || one>=2)
		              break;
		  }
		  if(!other || one<=1)
		        ans=ans*number;
	}
	ans.out();
	printf("\n");
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define MAXN 20001
#define mod 10000
char ch[2*MAXN];
struct bign
{
      int size;
      int n[MAXN];
      void reset()
      {
            memset(n,0,sizeof(n));
            size=0;
      }
      void in()
      {
      	    int len=0;
            while(true)
            {
            	 char chuse=getchar();
            	 if('0'<=chuse && chuse<='9')
            	       ch[++len]=chuse;
            	 else break;
			}
            size=(len+3)/4;
            int now=len-(size-1)*4;
            for(int i=1;i<=now;i++)
                  n[size]=n[size]*10+ch[i]-'0';
            for(int i=size-1;i>=1;i--)
                  for(int j=1;j<=4;j++)
                        n[i]=n[i]*10+ch[++now]-'0';
      }
      void out()
      {
            printf("%d",n[size]);
            for(int i=size-1;i>=1;i--)
                  printf("%04d",n[i]);
      }
      friend bign operator * (bign x,bign y)
      {
            bign ans;
            memset(ans.n,0,sizeof(ans.n));
            ans.size=x.size+y.size;
            for(int i=1;i<=x.size;i++)
                  for(int j=1;j<=y.size;j++)
                        ans.n[i+j-1]+=x.n[i]*y.n[j];
            for(int i=1;i<=ans.size;i++)
            {
                  if(ans.n[i]>=mod && i==ans.size)   ans.size++;
                  ans.n[i+1]+=ans.n[i]/mod;
                  ans.n[i]%=mod;
            }
            while(!ans.n[ans.size] && ans.size!=1)
                  ans.size--;
            return ans;
      }
}ans,number;
int N;
int main()
{
#ifndef ONLINE_JUDGE
      freopen("input.txt","r",stdin);
      freopen("output.txt","w",stdout);
#endif
	scanf("%d",&N);
	getchar();
	ans.reset();
	ans.size=1;
	ans.n[1]=1;
	for(int i=1;i<=N;i++)
	{
		  number.reset();
		  number.in();
		  int one=0;bool other=false;
		  for(int j=1;j<=number.size;j++)
		  {
		        if(number.n[j]==1)
		              one++;
		        if(number.n[j]!=1 && number.n[j]!=0)
		              other=true;
		        if(other || one>=2)
		              break;
		  }
		  if(!other || one<=1)
		        ans=ans*number;
	}
	ans.out();
	printf("\n");
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
#define MAXN 100001
string ch,ans;
int N,zeronum=0;
bool output=false;
int main()
{
#ifndef ONLINE_JUDGE
      freopen("input.txt","r",stdin);
      freopen("output.txt","w",stdout);
#endif
	scanf("%d",&N);
	for(int i=1;i<=N;i++)
	{
		  cin>>ch;
		  int len=ch.size();
		  if(len==1 && ch[0]=='0')
		  {
		  	    printf("0\n");
		  	    return 0;
		  }
		  int nowzeronum=0;
		  for(int j=len-1;j>=0;j--)
		        nowzeronum+=(ch[j]=='0');
		  zeronum+=nowzeronum;
		  if(!output && !(nowzeronum==len-1 && ch[0]=='1'))
		  {
		  	    ans=ch;
		  	    output=true;
		  	    zeronum-=nowzeronum;
		  }
	}
	if(!output)   printf("1");
	else   cout<<ans;
	for(int i=1;i<=zeronum;i++)
	      printf("0");
	printf("\n");
	return 0;
}


#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <locale>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <stdint.h>
#include <cassert>
#include <sstream>
#include <complex>
#include <fstream>
#include <functional>
#include <numeric>
#include <list>
#include <bitset>

#define FOR(i, n) for (int i = 0; i < n; ++i)

typedef unsigned long long ull;
typedef long long ll;

struct pairhash
{
	template <typename T, typename U>
	std::size_t operator()(const std::pair<T, U>& x) const
	{
		return std::hash<T>()(x.first) ^ std::hash<U>()(x.second);
	}
};

ll compute_gcd(ll a, ll b)
{
	if (b == 0) return a;
	return compute_gcd(b, a % b);
}

ull compute_lcm(ull a, ull b)
{
	ull gcd = compute_gcd(a, b);
	return a / gcd * b;
}

//-----------------------------------------------------------------------------------------

int main()
{
#ifndef ONLINE_JUDGE
	freopen("Source.txt", "rt", stdin);
#endif
	std::ios_base::sync_with_stdio(false);

	int n;
	std::cin >> n;

	int zeros = 0;
	int head = 1;
	FOR(i, n)
	{
		int number; std::cin >> number;
		if (number == 0)
		{
			std::cout << 0;
			return 0;
		}
		if (number == 1) continue;
		while (number)
		{
			if (number % 10 != 0) {
				if (number != 1) head = number;
				break;
			}

			number /= 10;
			++zeros;
		}
	}

	std::cout << head;
	FOR(i, zeros) std::cout << "0";

	return 0;
}


#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <locale>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <stdint.h>
#include <cassert>
#include <sstream>
#include <complex>
#include <fstream>
#include <functional>
#include <numeric>
#include <list>
#include <bitset>

#define FOR(i, n) for (int i = 0; i < n; ++i)

typedef unsigned long long ull;
typedef long long ll;

struct pairhash
{
	template <typename T, typename U>
	std::size_t operator()(const std::pair<T, U>& x) const
	{
		return std::hash<T>()(x.first) ^ std::hash<U>()(x.second);
	}
};

ll compute_gcd(ll a, ll b)
{
	if (b == 0) return a;
	return compute_gcd(b, a % b);
}

ull compute_lcm(ull a, ull b)
{
	ull gcd = compute_gcd(a, b);
	return a / gcd * b;
}

//-----------------------------------------------------------------------------------------

int main()
{
#ifndef ONLINE_JUDGE
	freopen("Source.txt", "rt", stdin);
#endif
	std::ios_base::sync_with_stdio(false);

	int n;
	std::cin >> n;

	ull zeros = 0;
	std::string head = "1";
	FOR(i, n)
	{
		std::string number;
		std::cin >> number;
		if (number == "0")
		{
			std::cout << 0;
			return 0;
		}

		for (int j = number.size() - 1; j >= 0; --j)
		{
			if (number[j] == '0') ++zeros;
			else if (j == 0 && number[j] == '1') continue;
			else {
				head = number.substr(0, j + 1);
				break;
			}
		}
	}

	std::cout << head;
	FOR(i, zeros) std::cout << "0";

	return 0;
}