import java.util.*;
import java.lang.Math;
import static java.lang.System.in;
import static java.lang.System.out;

public class Main{
    public static void main(String[] args){
	Scanner sc=new Scanner(in);
	String s=sc.next();
	String result="";
	for(int i=0;i<s.length();i++)
	    switch(s.substring(i,i+1)){
	    case "0":
		result+="0";
		break;
	    case "1":
		result+="1";
		break;
	    case "B":
        if(result.length()!=0)
		result=result.substring(0,result.length()-1);
		break;
	    }
	out.println(result);
    }
} import java.util.*; util.* java import java.lang.Math; Math java.lang import static java.lang.System.in; import static java.lang.System.in; import static java.lang.System.in; import static java.lang.System.out; import static java.lang.System.out; import static java.lang.System.out; public class Main{
    public static void main(String[] args){
	Scanner sc=new Scanner(in);
	String s=sc.next();
	String result="";
	for(int i=0;i<s.length();i++)
	    switch(s.substring(i,i+1)){
	    case "0":
		result+="0";
		break;
	    case "1":
		result+="1";
		break;
	    case "B":
        if(result.length()!=0)
		result=result.substring(0,result.length()-1);
		break;
	    }
	out.println(result);
    }
} Main public static void main(String[] args){
	Scanner sc=new Scanner(in);
	String s=sc.next();
	String result="";
	for(int i=0;i<s.length();i++)
	    switch(s.substring(i,i+1)){
	    case "0":
		result+="0";
		break;
	    case "1":
		result+="1";
		break;
	    case "B":
        if(result.length()!=0)
		result=result.substring(0,result.length()-1);
		break;
	    }
	out.println(result);
    } main {
	Scanner sc=new Scanner(in);
	String s=sc.next();
	String result="";
	for(int i=0;i<s.length();i++)
	    switch(s.substring(i,i+1)){
	    case "0":
		result+="0";
		break;
	    case "1":
		result+="1";
		break;
	    case "B":
        if(result.length()!=0)
		result=result.substring(0,result.length()-1);
		break;
	    }
	out.println(result);
    } Scanner sc=new Scanner(in); sc new Scanner(in) String s=sc.next(); s sc.next() sc.next sc String result=""; result "" for(int i=0;i<s.length();i++)
	    switch(s.substring(i,i+1)){
	    case "0":
		result+="0";
		break;
	    case "1":
		result+="1";
		break;
	    case "B":
        if(result.length()!=0)
		result=result.substring(0,result.length()-1);
		break;
	    } int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i switch(s.substring(i,i+1)){
	    case "0":
		result+="0";
		break;
	    case "1":
		result+="1";
		break;
	    case "B":
        if(result.length()!=0)
		result=result.substring(0,result.length()-1);
		break;
	    } switch(s.substring(i,i+1)){
	    case "0":
		result+="0";
		break;
	    case "1":
		result+="1";
		break;
	    case "B":
        if(result.length()!=0)
		result=result.substring(0,result.length()-1);
		break;
	    } s.substring(i,i+1) s.substring s i i+1 i 1 case "0": "0" case "0": result+="0" result "0" break; case "1": "1" case "1": result+="1" result "1" break; case "B": "B" case "B": if(result.length()!=0)
		result=result.substring(0,result.length()-1); result.length()!=0 result.length() result.length result 0 result=result.substring(0,result.length()-1) result result.substring(0,result.length()-1) result.substring result 0 result.length()-1 result.length() result.length result 1 break; out.println(result) out.println out result String[] args args public class Main{
    public static void main(String[] args){
	Scanner sc=new Scanner(in);
	String s=sc.next();
	String result="";
	for(int i=0;i<s.length();i++)
	    switch(s.substring(i,i+1)){
	    case "0":
		result+="0";
		break;
	    case "1":
		result+="1";
		break;
	    case "B":
        if(result.length()!=0)
		result=result.substring(0,result.length()-1);
		break;
	    }
	out.println(result);
    }
} public class Main{
    public static void main(String[] args){
	Scanner sc=new Scanner(in);
	String s=sc.next();
	String result="";
	for(int i=0;i<s.length();i++)
	    switch(s.substring(i,i+1)){
	    case "0":
		result+="0";
		break;
	    case "1":
		result+="1";
		break;
	    case "B":
        if(result.length()!=0)
		result=result.substring(0,result.length()-1);
		break;
	    }
	out.println(result);
    }
} Main
import java.util.*;
import java.lang.Math;
import static java.lang.System.in;
import static java.lang.System.out;

public class Main{
    public static void main(String[] args){
	Scanner sc=new Scanner(in);
	String s=sc.next();
	String result="";
	for(int i=0;i<s.length();i++)
	    switch(s.substring(i,i+1)){
	    case "0":
		result+="0";
		break;
	    case "1":
		result+="1";
		break;
	    case "B":
        if(result.length()!=0)
		result=result.substring(0,result.length()-1);
		break;
	    }
	out.println(result);
    }
}
