import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] s = new char[str.length()];
        s = str.toCharArray();    

        StringBuilder ans = new StringBuilder("");

        for(int i = 0 ; i < str.length() ; i ++){
            if (s[i] == '0' || s[i] == '1') {
                ans.append(s[i]);
//                System.out.println(s[i]);
//                System.out.println(ans);
            }

            else if(ans.length() != 0){
                ans.setLength(ans.length()-1);
            }
        }

        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] s = new char[str.length()];
        s = str.toCharArray();    

        StringBuilder ans = new StringBuilder("");

        for(int i = 0 ; i < str.length() ; i ++){
            if (s[i] == '0' || s[i] == '1') {
                ans.append(s[i]);
//                System.out.println(s[i]);
//                System.out.println(ans);
            }

            else if(ans.length() != 0){
                ans.setLength(ans.length()-1);
            }
        }

        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] s = new char[str.length()];
        s = str.toCharArray();    

        StringBuilder ans = new StringBuilder("");

        for(int i = 0 ; i < str.length() ; i ++){
            if (s[i] == '0' || s[i] == '1') {
                ans.append(s[i]);
//                System.out.println(s[i]);
//                System.out.println(ans);
            }

            else if(ans.length() != 0){
                ans.setLength(ans.length()-1);
            }
        }

        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] s = new char[str.length()];
        s = str.toCharArray();    

        StringBuilder ans = new StringBuilder("");

        for(int i = 0 ; i < str.length() ; i ++){
            if (s[i] == '0' || s[i] == '1') {
                ans.append(s[i]);
//                System.out.println(s[i]);
//                System.out.println(ans);
            }

            else if(ans.length() != 0){
                ans.setLength(ans.length()-1);
            }
        }

        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc char[] s = new char[str.length()]; s new char[str.length()] str.length() str.length str s = str.toCharArray() s str.toCharArray() str.toCharArray str StringBuilder ans = new StringBuilder(""); ans new StringBuilder("") for(int i = 0 ; i < str.length() ; i ++){
            if (s[i] == '0' || s[i] == '1') {
                ans.append(s[i]);
//                System.out.println(s[i]);
//                System.out.println(ans);
            }

            else if(ans.length() != 0){
                ans.setLength(ans.length()-1);
            }
        } int i = 0 ; int i = 0 ; i 0 i < str.length() i str.length() str.length str i ++ i ++ i {
            if (s[i] == '0' || s[i] == '1') {
                ans.append(s[i]);
//                System.out.println(s[i]);
//                System.out.println(ans);
            }

            else if(ans.length() != 0){
                ans.setLength(ans.length()-1);
            }
        } {
            if (s[i] == '0' || s[i] == '1') {
                ans.append(s[i]);
//                System.out.println(s[i]);
//                System.out.println(ans);
            }

            else if(ans.length() != 0){
                ans.setLength(ans.length()-1);
            }
        } if (s[i] == '0' || s[i] == '1') {
                ans.append(s[i]);
//                System.out.println(s[i]);
//                System.out.println(ans);
            }

            else if(ans.length() != 0){
                ans.setLength(ans.length()-1);
            } s[i] == '0' || s[i] == '1' s[i] == '0' s[i] s i '0' s[i] == '1' s[i] s i '1' {
                ans.append(s[i]);
//                System.out.println(s[i]);
//                System.out.println(ans);
            } ans.append(s[i]) ans.append ans s[i] s i if(ans.length() != 0){
                ans.setLength(ans.length()-1);
            } ans.length() != 0 ans.length() ans.length ans 0 {
                ans.setLength(ans.length()-1);
            } ans.setLength(ans.length()-1) ans.setLength ans ans.length()-1 ans.length() ans.length ans 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] s = new char[str.length()];
        s = str.toCharArray();    

        StringBuilder ans = new StringBuilder("");

        for(int i = 0 ; i < str.length() ; i ++){
            if (s[i] == '0' || s[i] == '1') {
                ans.append(s[i]);
//                System.out.println(s[i]);
//                System.out.println(ans);
            }

            else if(ans.length() != 0){
                ans.setLength(ans.length()-1);
            }
        }

        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] s = new char[str.length()];
        s = str.toCharArray();    

        StringBuilder ans = new StringBuilder("");

        for(int i = 0 ; i < str.length() ; i ++){
            if (s[i] == '0' || s[i] == '1') {
                ans.append(s[i]);
//                System.out.println(s[i]);
//                System.out.println(ans);
            }

            else if(ans.length() != 0){
                ans.setLength(ans.length()-1);
            }
        }

        System.out.println(ans);
    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] s = new char[str.length()];
        s = str.toCharArray();    

        StringBuilder ans = new StringBuilder("");

        for(int i = 0 ; i < str.length() ; i ++){
            if (s[i] == '0' || s[i] == '1') {
                ans.append(s[i]);
//                System.out.println(s[i]);
//                System.out.println(ans);
            }

            else if(ans.length() != 0){
                ans.setLength(ans.length()-1);
            }
        }

        System.out.println(ans);
    }
}