import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] cl = sc.next().toCharArray();
        String ans = "";
        for(char c : cl){
            if(c == '0'){
                ans += "0";
            }else if(c == '1'){
                ans += "1";
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
            }
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] cl = sc.next().toCharArray();
        String ans = "";
        for(char c : cl){
            if(c == '0'){
                ans += "0";
            }else if(c == '1'){
                ans += "1";
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] cl = sc.next().toCharArray();
        String ans = "";
        for(char c : cl){
            if(c == '0'){
                ans += "0";
            }else if(c == '1'){
                ans += "1";
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        char[] cl = sc.next().toCharArray();
        String ans = "";
        for(char c : cl){
            if(c == '0'){
                ans += "0";
            }else if(c == '1'){
                ans += "1";
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
            }
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] cl = sc.next().toCharArray(); cl sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc String ans = ""; ans "" for(char c : cl){
            if(c == '0'){
                ans += "0";
            }else if(c == '1'){
                ans += "1";
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
            }
        } char c cl {
            if(c == '0'){
                ans += "0";
            }else if(c == '1'){
                ans += "1";
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
            }
        } {
            if(c == '0'){
                ans += "0";
            }else if(c == '1'){
                ans += "1";
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
            }
        } if(c == '0'){
                ans += "0";
            }else if(c == '1'){
                ans += "1";
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
            } c == '0' c '0' {
                ans += "0";
            } ans += "0" ans "0" if(c == '1'){
                ans += "1";
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
            } c == '1' c '1' {
                ans += "1";
            } ans += "1" ans "1" {
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
            } 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) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] cl = sc.next().toCharArray();
        String ans = "";
        for(char c : cl){
            if(c == '0'){
                ans += "0";
            }else if(c == '1'){
                ans += "1";
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] cl = sc.next().toCharArray();
        String ans = "";
        for(char c : cl){
            if(c == '0'){
                ans += "0";
            }else if(c == '1'){
                ans += "1";
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] cl = sc.next().toCharArray();
        String ans = "";
        for(char c : cl){
            if(c == '0'){
                ans += "0";
            }else if(c == '1'){
                ans += "1";
            }else{
                if(ans.length() != 0){
                    ans = ans.substring(0,ans.length()-1);
                }
            }
        }
        System.out.println(ans);
    }
}
