import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        char[] array = sc.next().toCharArray();
        for (char tmp : array) {
            if (tmp == '0') {
                sb.append('0');
            } else if (tmp == '1') {
                sb.append('1');
            } else if (sb.length() > 0 && tmp == 'B'){
                sb.deleteCharAt(sb.length() - 1);
            }
        }
        System.out.println(sb.toString());
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        char[] array = sc.next().toCharArray();
        for (char tmp : array) {
            if (tmp == '0') {
                sb.append('0');
            } else if (tmp == '1') {
                sb.append('1');
            } else if (sb.length() > 0 && tmp == 'B'){
                sb.deleteCharAt(sb.length() - 1);
            }
        }
        System.out.println(sb.toString());
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        char[] array = sc.next().toCharArray();
        for (char tmp : array) {
            if (tmp == '0') {
                sb.append('0');
            } else if (tmp == '1') {
                sb.append('1');
            } else if (sb.length() > 0 && tmp == 'B'){
                sb.deleteCharAt(sb.length() - 1);
            }
        }
        System.out.println(sb.toString());
    } main {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        char[] array = sc.next().toCharArray();
        for (char tmp : array) {
            if (tmp == '0') {
                sb.append('0');
            } else if (tmp == '1') {
                sb.append('1');
            } else if (sb.length() > 0 && tmp == 'B'){
                sb.deleteCharAt(sb.length() - 1);
            }
        }
        System.out.println(sb.toString());
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() char[] array = sc.next().toCharArray(); array sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc for (char tmp : array) {
            if (tmp == '0') {
                sb.append('0');
            } else if (tmp == '1') {
                sb.append('1');
            } else if (sb.length() > 0 && tmp == 'B'){
                sb.deleteCharAt(sb.length() - 1);
            }
        } char tmp array {
            if (tmp == '0') {
                sb.append('0');
            } else if (tmp == '1') {
                sb.append('1');
            } else if (sb.length() > 0 && tmp == 'B'){
                sb.deleteCharAt(sb.length() - 1);
            }
        } {
            if (tmp == '0') {
                sb.append('0');
            } else if (tmp == '1') {
                sb.append('1');
            } else if (sb.length() > 0 && tmp == 'B'){
                sb.deleteCharAt(sb.length() - 1);
            }
        } if (tmp == '0') {
                sb.append('0');
            } else if (tmp == '1') {
                sb.append('1');
            } else if (sb.length() > 0 && tmp == 'B'){
                sb.deleteCharAt(sb.length() - 1);
            } tmp == '0' tmp '0' {
                sb.append('0');
            } sb.append('0') sb.append sb '0' if (tmp == '1') {
                sb.append('1');
            } else if (sb.length() > 0 && tmp == 'B'){
                sb.deleteCharAt(sb.length() - 1);
            } tmp == '1' tmp '1' {
                sb.append('1');
            } sb.append('1') sb.append sb '1' if (sb.length() > 0 && tmp == 'B'){
                sb.deleteCharAt(sb.length() - 1);
            } sb.length() > 0 && tmp == 'B' sb.length() > 0 sb.length() sb.length sb 0 tmp == 'B' tmp 'B' {
                sb.deleteCharAt(sb.length() - 1);
            } sb.deleteCharAt(sb.length() - 1) sb.deleteCharAt sb sb.length() - 1 sb.length() sb.length sb 1 System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        char[] array = sc.next().toCharArray();
        for (char tmp : array) {
            if (tmp == '0') {
                sb.append('0');
            } else if (tmp == '1') {
                sb.append('1');
            } else if (sb.length() > 0 && tmp == 'B'){
                sb.deleteCharAt(sb.length() - 1);
            }
        }
        System.out.println(sb.toString());
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        char[] array = sc.next().toCharArray();
        for (char tmp : array) {
            if (tmp == '0') {
                sb.append('0');
            } else if (tmp == '1') {
                sb.append('1');
            } else if (sb.length() > 0 && tmp == 'B'){
                sb.deleteCharAt(sb.length() - 1);
            }
        }
        System.out.println(sb.toString());
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        char[] array = sc.next().toCharArray();
        for (char tmp : array) {
            if (tmp == '0') {
                sb.append('0');
            } else if (tmp == '1') {
                sb.append('1');
            } else if (sb.length() > 0 && tmp == 'B'){
                sb.deleteCharAt(sb.length() - 1);
            }
        }
        System.out.println(sb.toString());
    }
}