import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        StringBuilder A = new StringBuilder();
        for(int i = 0;i < S.length();i++){
            switch (S.charAt(i)) {
                case '0':
                A.append(S.charAt(i));
                break;
                case 'B':
                if(A.length() != 0){
                    A.setLength(A.length()-1);
                }
                break;
                case '1':
                A.append(S.charAt(i));
                break;
            }
        }
        System.out.println(A);
        
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        StringBuilder A = new StringBuilder();
        for(int i = 0;i < S.length();i++){
            switch (S.charAt(i)) {
                case '0':
                A.append(S.charAt(i));
                break;
                case 'B':
                if(A.length() != 0){
                    A.setLength(A.length()-1);
                }
                break;
                case '1':
                A.append(S.charAt(i));
                break;
            }
        }
        System.out.println(A);
        
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        StringBuilder A = new StringBuilder();
        for(int i = 0;i < S.length();i++){
            switch (S.charAt(i)) {
                case '0':
                A.append(S.charAt(i));
                break;
                case 'B':
                if(A.length() != 0){
                    A.setLength(A.length()-1);
                }
                break;
                case '1':
                A.append(S.charAt(i));
                break;
            }
        }
        System.out.println(A);
        
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        StringBuilder A = new StringBuilder();
        for(int i = 0;i < S.length();i++){
            switch (S.charAt(i)) {
                case '0':
                A.append(S.charAt(i));
                break;
                case 'B':
                if(A.length() != 0){
                    A.setLength(A.length()-1);
                }
                break;
                case '1':
                A.append(S.charAt(i));
                break;
            }
        }
        System.out.println(A);
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc StringBuilder A = new StringBuilder(); A new StringBuilder() for(int i = 0;i < S.length();i++){
            switch (S.charAt(i)) {
                case '0':
                A.append(S.charAt(i));
                break;
                case 'B':
                if(A.length() != 0){
                    A.setLength(A.length()-1);
                }
                break;
                case '1':
                A.append(S.charAt(i));
                break;
            }
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            switch (S.charAt(i)) {
                case '0':
                A.append(S.charAt(i));
                break;
                case 'B':
                if(A.length() != 0){
                    A.setLength(A.length()-1);
                }
                break;
                case '1':
                A.append(S.charAt(i));
                break;
            }
        } {
            switch (S.charAt(i)) {
                case '0':
                A.append(S.charAt(i));
                break;
                case 'B':
                if(A.length() != 0){
                    A.setLength(A.length()-1);
                }
                break;
                case '1':
                A.append(S.charAt(i));
                break;
            }
        } switch (S.charAt(i)) {
                case '0':
                A.append(S.charAt(i));
                break;
                case 'B':
                if(A.length() != 0){
                    A.setLength(A.length()-1);
                }
                break;
                case '1':
                A.append(S.charAt(i));
                break;
            } S.charAt(i) S.charAt S i case '0': '0' case '0': A.append(S.charAt(i)) A.append A S.charAt(i) S.charAt S i break; case 'B': 'B' case 'B': if(A.length() != 0){
                    A.setLength(A.length()-1);
                } A.length() != 0 A.length() A.length A 0 {
                    A.setLength(A.length()-1);
                } A.setLength(A.length()-1) A.setLength A A.length()-1 A.length() A.length A 1 break; case '1': '1' case '1': A.append(S.charAt(i)) A.append A S.charAt(i) S.charAt S i break; System.out.println(A) System.out.println System.out System System.out A String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        StringBuilder A = new StringBuilder();
        for(int i = 0;i < S.length();i++){
            switch (S.charAt(i)) {
                case '0':
                A.append(S.charAt(i));
                break;
                case 'B':
                if(A.length() != 0){
                    A.setLength(A.length()-1);
                }
                break;
                case '1':
                A.append(S.charAt(i));
                break;
            }
        }
        System.out.println(A);
        
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        StringBuilder A = new StringBuilder();
        for(int i = 0;i < S.length();i++){
            switch (S.charAt(i)) {
                case '0':
                A.append(S.charAt(i));
                break;
                case 'B':
                if(A.length() != 0){
                    A.setLength(A.length()-1);
                }
                break;
                case '1':
                A.append(S.charAt(i));
                break;
            }
        }
        System.out.println(A);
        
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        StringBuilder A = new StringBuilder();
        for(int i = 0;i < S.length();i++){
            switch (S.charAt(i)) {
                case '0':
                A.append(S.charAt(i));
                break;
                case 'B':
                if(A.length() != 0){
                    A.setLength(A.length()-1);
                }
                break;
                case '1':
                A.append(S.charAt(i));
                break;
            }
        }
        System.out.println(A);
        
    }
}
