import java.util.*;
//import java.util.stream.Collectors;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		String result = "";
		for(int i=0; i<s.length(); i++){
			switch(s.charAt(i)){
			case '0':
				result += 0;
				break;
			case '1':
				result += 1;
				break;
			case'B':
				if(!result.isEmpty()){
					result = result.substring(0, result.length() - 1);
				}
				break;
			}
		}
		System.out.println(result);
	}
} 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 result = "";
		for(int i=0; i<s.length(); i++){
			switch(s.charAt(i)){
			case '0':
				result += 0;
				break;
			case '1':
				result += 1;
				break;
			case'B':
				if(!result.isEmpty()){
					result = result.substring(0, result.length() - 1);
				}
				break;
			}
		}
		System.out.println(result);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		String result = "";
		for(int i=0; i<s.length(); i++){
			switch(s.charAt(i)){
			case '0':
				result += 0;
				break;
			case '1':
				result += 1;
				break;
			case'B':
				if(!result.isEmpty()){
					result = result.substring(0, result.length() - 1);
				}
				break;
			}
		}
		System.out.println(result);
	} main {
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		String result = "";
		for(int i=0; i<s.length(); i++){
			switch(s.charAt(i)){
			case '0':
				result += 0;
				break;
			case '1':
				result += 1;
				break;
			case'B':
				if(!result.isEmpty()){
					result = result.substring(0, result.length() - 1);
				}
				break;
			}
		}
		System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String result = ""; result "" for(int i=0; i<s.length(); i++){
			switch(s.charAt(i)){
			case '0':
				result += 0;
				break;
			case '1':
				result += 1;
				break;
			case'B':
				if(!result.isEmpty()){
					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.charAt(i)){
			case '0':
				result += 0;
				break;
			case '1':
				result += 1;
				break;
			case'B':
				if(!result.isEmpty()){
					result = result.substring(0, result.length() - 1);
				}
				break;
			}
		} {
			switch(s.charAt(i)){
			case '0':
				result += 0;
				break;
			case '1':
				result += 1;
				break;
			case'B':
				if(!result.isEmpty()){
					result = result.substring(0, result.length() - 1);
				}
				break;
			}
		} switch(s.charAt(i)){
			case '0':
				result += 0;
				break;
			case '1':
				result += 1;
				break;
			case'B':
				if(!result.isEmpty()){
					result = result.substring(0, result.length() - 1);
				}
				break;
			} s.charAt(i) s.charAt s i 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.isEmpty()){
					result = result.substring(0, result.length() - 1);
				} !result.isEmpty() result.isEmpty() result.isEmpty result {
					result = result.substring(0, result.length() - 1);
				} 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; 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 sc = new Scanner(System.in);
		
		String s = sc.next();
		String result = "";
		for(int i=0; i<s.length(); i++){
			switch(s.charAt(i)){
			case '0':
				result += 0;
				break;
			case '1':
				result += 1;
				break;
			case'B':
				if(!result.isEmpty()){
					result = result.substring(0, result.length() - 1);
				}
				break;
			}
		}
		System.out.println(result);
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		String result = "";
		for(int i=0; i<s.length(); i++){
			switch(s.charAt(i)){
			case '0':
				result += 0;
				break;
			case '1':
				result += 1;
				break;
			case'B':
				if(!result.isEmpty()){
					result = result.substring(0, result.length() - 1);
				}
				break;
			}
		}
		System.out.println(result);
	}
} Main
import java.util.*;
//import java.util.stream.Collectors;

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