import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String[] sp = S.split("");
        Deque<String> deque = new ArrayDeque<>();
        for(String s : sp) {
            if(s.equals("0") || s.equals("1")) deque.push(s);
            else {
                if(deque.size() != 0) deque.pop();
            }
        }
        StringBuilder ans = new StringBuilder();
        for(String a : deque) {
            ans.insert(0, a);
        }
        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 S = sc.next();
        String[] sp = S.split("");
        Deque<String> deque = new ArrayDeque<>();
        for(String s : sp) {
            if(s.equals("0") || s.equals("1")) deque.push(s);
            else {
                if(deque.size() != 0) deque.pop();
            }
        }
        StringBuilder ans = new StringBuilder();
        for(String a : deque) {
            ans.insert(0, a);
        }
        System.out.println(ans);
    }
    
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String[] sp = S.split("");
        Deque<String> deque = new ArrayDeque<>();
        for(String s : sp) {
            if(s.equals("0") || s.equals("1")) deque.push(s);
            else {
                if(deque.size() != 0) deque.pop();
            }
        }
        StringBuilder ans = new StringBuilder();
        for(String a : deque) {
            ans.insert(0, a);
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String[] sp = S.split("");
        Deque<String> deque = new ArrayDeque<>();
        for(String s : sp) {
            if(s.equals("0") || s.equals("1")) deque.push(s);
            else {
                if(deque.size() != 0) deque.pop();
            }
        }
        StringBuilder ans = new StringBuilder();
        for(String a : deque) {
            ans.insert(0, a);
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc String[] sp = S.split(""); sp S.split("") S.split S "" Deque<String> deque = new ArrayDeque<>(); deque new ArrayDeque<>() for(String s : sp) {
            if(s.equals("0") || s.equals("1")) deque.push(s);
            else {
                if(deque.size() != 0) deque.pop();
            }
        } String s sp {
            if(s.equals("0") || s.equals("1")) deque.push(s);
            else {
                if(deque.size() != 0) deque.pop();
            }
        } {
            if(s.equals("0") || s.equals("1")) deque.push(s);
            else {
                if(deque.size() != 0) deque.pop();
            }
        } if(s.equals("0") || s.equals("1")) deque.push(s);
            else {
                if(deque.size() != 0) deque.pop();
            } s.equals("0") || s.equals("1") s.equals("0") s.equals s "0" s.equals("1") s.equals s "1" deque.push(s) deque.push deque s {
                if(deque.size() != 0) deque.pop();
            } if(deque.size() != 0) deque.pop(); deque.size() != 0 deque.size() deque.size deque 0 deque.pop() deque.pop deque StringBuilder ans = new StringBuilder(); ans new StringBuilder() for(String a : deque) {
            ans.insert(0, a);
        } String a deque {
            ans.insert(0, a);
        } {
            ans.insert(0, a);
        } ans.insert(0, a) ans.insert ans 0 a 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 S = sc.next();
        String[] sp = S.split("");
        Deque<String> deque = new ArrayDeque<>();
        for(String s : sp) {
            if(s.equals("0") || s.equals("1")) deque.push(s);
            else {
                if(deque.size() != 0) deque.pop();
            }
        }
        StringBuilder ans = new StringBuilder();
        for(String a : deque) {
            ans.insert(0, a);
        }
        System.out.println(ans);
    }
    
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String[] sp = S.split("");
        Deque<String> deque = new ArrayDeque<>();
        for(String s : sp) {
            if(s.equals("0") || s.equals("1")) deque.push(s);
            else {
                if(deque.size() != 0) deque.pop();
            }
        }
        StringBuilder ans = new StringBuilder();
        for(String a : deque) {
            ans.insert(0, a);
        }
        System.out.println(ans);
    }
    
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String[] sp = S.split("");
        Deque<String> deque = new ArrayDeque<>();
        for(String s : sp) {
            if(s.equals("0") || s.equals("1")) deque.push(s);
            else {
                if(deque.size() != 0) deque.pop();
            }
        }
        StringBuilder ans = new StringBuilder();
        for(String a : deque) {
            ans.insert(0, a);
        }
        System.out.println(ans);
    }
    
}