import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String n;
        n = in.nextLine();
        StringBuilder result =new StringBuilder();
//        System.out.println(result.length());
        for(int i = 0 ;i<n.length();i++){
            if(n.charAt(i) == '0'){
                result.append(0);
            } else if(n.charAt(i) == '1'){
                result.append(1);
            }
            else{
                if(result.length() == 0){
                    continue;
                }else{
                    result.deleteCharAt(result.length() - 1);
                }
            }
        }
        System.out.println(result);


    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String n;
        n = in.nextLine();
        StringBuilder result =new StringBuilder();
//        System.out.println(result.length());
        for(int i = 0 ;i<n.length();i++){
            if(n.charAt(i) == '0'){
                result.append(0);
            } else if(n.charAt(i) == '1'){
                result.append(1);
            }
            else{
                if(result.length() == 0){
                    continue;
                }else{
                    result.deleteCharAt(result.length() - 1);
                }
            }
        }
        System.out.println(result);


    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String n;
        n = in.nextLine();
        StringBuilder result =new StringBuilder();
//        System.out.println(result.length());
        for(int i = 0 ;i<n.length();i++){
            if(n.charAt(i) == '0'){
                result.append(0);
            } else if(n.charAt(i) == '1'){
                result.append(1);
            }
            else{
                if(result.length() == 0){
                    continue;
                }else{
                    result.deleteCharAt(result.length() - 1);
                }
            }
        }
        System.out.println(result);


    } main {
        Scanner in = new Scanner(System.in);
        String n;
        n = in.nextLine();
        StringBuilder result =new StringBuilder();
//        System.out.println(result.length());
        for(int i = 0 ;i<n.length();i++){
            if(n.charAt(i) == '0'){
                result.append(0);
            } else if(n.charAt(i) == '1'){
                result.append(1);
            }
            else{
                if(result.length() == 0){
                    continue;
                }else{
                    result.deleteCharAt(result.length() - 1);
                }
            }
        }
        System.out.println(result);


    } Scanner in = new Scanner(System.in); in new Scanner(System.in) String n; n n = in.nextLine() n in.nextLine() in.nextLine in StringBuilder result =new StringBuilder(); result new StringBuilder() for(int i = 0 ;i<n.length();i++){
            if(n.charAt(i) == '0'){
                result.append(0);
            } else if(n.charAt(i) == '1'){
                result.append(1);
            }
            else{
                if(result.length() == 0){
                    continue;
                }else{
                    result.deleteCharAt(result.length() - 1);
                }
            }
        } int i = 0 ; int i = 0 ; i 0 i<n.length() i n.length() n.length n i++ i++ i {
            if(n.charAt(i) == '0'){
                result.append(0);
            } else if(n.charAt(i) == '1'){
                result.append(1);
            }
            else{
                if(result.length() == 0){
                    continue;
                }else{
                    result.deleteCharAt(result.length() - 1);
                }
            }
        } {
            if(n.charAt(i) == '0'){
                result.append(0);
            } else if(n.charAt(i) == '1'){
                result.append(1);
            }
            else{
                if(result.length() == 0){
                    continue;
                }else{
                    result.deleteCharAt(result.length() - 1);
                }
            }
        } if(n.charAt(i) == '0'){
                result.append(0);
            } else if(n.charAt(i) == '1'){
                result.append(1);
            }
            else{
                if(result.length() == 0){
                    continue;
                }else{
                    result.deleteCharAt(result.length() - 1);
                }
            } n.charAt(i) == '0' n.charAt(i) n.charAt n i '0' {
                result.append(0);
            } result.append(0) result.append result 0 if(n.charAt(i) == '1'){
                result.append(1);
            }
            else{
                if(result.length() == 0){
                    continue;
                }else{
                    result.deleteCharAt(result.length() - 1);
                }
            } n.charAt(i) == '1' n.charAt(i) n.charAt n i '1' {
                result.append(1);
            } result.append(1) result.append result 1 {
                if(result.length() == 0){
                    continue;
                }else{
                    result.deleteCharAt(result.length() - 1);
                }
            } if(result.length() == 0){
                    continue;
                }else{
                    result.deleteCharAt(result.length() - 1);
                } result.length() == 0 result.length() result.length result 0 {
                    continue;
                } continue; {
                    result.deleteCharAt(result.length() - 1);
                } result.deleteCharAt(result.length() - 1) result.deleteCharAt result result.length() - 1 result.length() result.length result 1 System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String n;
        n = in.nextLine();
        StringBuilder result =new StringBuilder();
//        System.out.println(result.length());
        for(int i = 0 ;i<n.length();i++){
            if(n.charAt(i) == '0'){
                result.append(0);
            } else if(n.charAt(i) == '1'){
                result.append(1);
            }
            else{
                if(result.length() == 0){
                    continue;
                }else{
                    result.deleteCharAt(result.length() - 1);
                }
            }
        }
        System.out.println(result);


    }
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String n;
        n = in.nextLine();
        StringBuilder result =new StringBuilder();
//        System.out.println(result.length());
        for(int i = 0 ;i<n.length();i++){
            if(n.charAt(i) == '0'){
                result.append(0);
            } else if(n.charAt(i) == '1'){
                result.append(1);
            }
            else{
                if(result.length() == 0){
                    continue;
                }else{
                    result.deleteCharAt(result.length() - 1);
                }
            }
        }
        System.out.println(result);


    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String n;
        n = in.nextLine();
        StringBuilder result =new StringBuilder();
//        System.out.println(result.length());
        for(int i = 0 ;i<n.length();i++){
            if(n.charAt(i) == '0'){
                result.append(0);
            } else if(n.charAt(i) == '1'){
                result.append(1);
            }
            else{
                if(result.length() == 0){
                    continue;
                }else{
                    result.deleteCharAt(result.length() - 1);
                }
            }
        }
        System.out.println(result);


    }
}
