import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int N = str.length();
        String ans = "";
        
        for(int i=0; i<N; i++){
            if(str.charAt(i) == '0'){
                ans += '0';
                //System.out.println("0:"+ans);
            }else if(str.charAt(i) == '1'){
                ans += '1';
                //System.out.println("1:"+ans);
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
                //System.out.println(ans.length()+":"+ans);
            }
        }
        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();
        int N = str.length();
        String ans = "";
        
        for(int i=0; i<N; i++){
            if(str.charAt(i) == '0'){
                ans += '0';
                //System.out.println("0:"+ans);
            }else if(str.charAt(i) == '1'){
                ans += '1';
                //System.out.println("1:"+ans);
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
                //System.out.println(ans.length()+":"+ans);
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int N = str.length();
        String ans = "";
        
        for(int i=0; i<N; i++){
            if(str.charAt(i) == '0'){
                ans += '0';
                //System.out.println("0:"+ans);
            }else if(str.charAt(i) == '1'){
                ans += '1';
                //System.out.println("1:"+ans);
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
                //System.out.println(ans.length()+":"+ans);
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int N = str.length();
        String ans = "";
        
        for(int i=0; i<N; i++){
            if(str.charAt(i) == '0'){
                ans += '0';
                //System.out.println("0:"+ans);
            }else if(str.charAt(i) == '1'){
                ans += '1';
                //System.out.println("1:"+ans);
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
                //System.out.println(ans.length()+":"+ans);
            }
        }
        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 int N = str.length(); N str.length() str.length str String ans = ""; ans "" for(int i=0; i<N; i++){
            if(str.charAt(i) == '0'){
                ans += '0';
                //System.out.println("0:"+ans);
            }else if(str.charAt(i) == '1'){
                ans += '1';
                //System.out.println("1:"+ans);
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
                //System.out.println(ans.length()+":"+ans);
            }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            if(str.charAt(i) == '0'){
                ans += '0';
                //System.out.println("0:"+ans);
            }else if(str.charAt(i) == '1'){
                ans += '1';
                //System.out.println("1:"+ans);
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
                //System.out.println(ans.length()+":"+ans);
            }
        } {
            if(str.charAt(i) == '0'){
                ans += '0';
                //System.out.println("0:"+ans);
            }else if(str.charAt(i) == '1'){
                ans += '1';
                //System.out.println("1:"+ans);
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
                //System.out.println(ans.length()+":"+ans);
            }
        } if(str.charAt(i) == '0'){
                ans += '0';
                //System.out.println("0:"+ans);
            }else if(str.charAt(i) == '1'){
                ans += '1';
                //System.out.println("1:"+ans);
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
                //System.out.println(ans.length()+":"+ans);
            } str.charAt(i) == '0' str.charAt(i) str.charAt str i '0' {
                ans += '0';
                //System.out.println("0:"+ans);
            } ans += '0' ans '0' if(str.charAt(i) == '1'){
                ans += '1';
                //System.out.println("1:"+ans);
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
                //System.out.println(ans.length()+":"+ans);
            } str.charAt(i) == '1' str.charAt(i) str.charAt str i '1' {
                ans += '1';
                //System.out.println("1:"+ans);
            } ans += '1' ans '1' {
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
                //System.out.println(ans.length()+":"+ans);
            } if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                } ans.length() != 0 ans.length() ans.length ans 0 {
                    ans = ans.substring(0,ans.length()-1);
                } ans = ans.substring(0,ans.length()-1) ans ans.substring(0,ans.length()-1) ans.substring ans 0 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();
        int N = str.length();
        String ans = "";
        
        for(int i=0; i<N; i++){
            if(str.charAt(i) == '0'){
                ans += '0';
                //System.out.println("0:"+ans);
            }else if(str.charAt(i) == '1'){
                ans += '1';
                //System.out.println("1:"+ans);
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
                //System.out.println(ans.length()+":"+ans);
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int N = str.length();
        String ans = "";
        
        for(int i=0; i<N; i++){
            if(str.charAt(i) == '0'){
                ans += '0';
                //System.out.println("0:"+ans);
            }else if(str.charAt(i) == '1'){
                ans += '1';
                //System.out.println("1:"+ans);
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
                //System.out.println(ans.length()+":"+ans);
            }
        }
        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();
        int N = str.length();
        String ans = "";
        
        for(int i=0; i<N; i++){
            if(str.charAt(i) == '0'){
                ans += '0';
                //System.out.println("0:"+ans);
            }else if(str.charAt(i) == '1'){
                ans += '1';
                //System.out.println("1:"+ans);
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
                //System.out.println(ans.length()+":"+ans);
            }
        }
        System.out.println(ans);
    }
}
