import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String keyboard = sc.next();
		char[] keychars = keyboard.toCharArray();
		
		String editer = "";
		for(char c:keychars) {
			switch(c) {
				case '0':
					editer += "0";
					break;
				case '1':
					editer += "1";
					break;
				case 'B':
					if(editer.length() == 0) {break;}
					editer = editer.substring(0,editer.length()-1);
			}
		}
		
		System.out.println(editer);
		sc.close();
		
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String keyboard = sc.next();
		char[] keychars = keyboard.toCharArray();
		
		String editer = "";
		for(char c:keychars) {
			switch(c) {
				case '0':
					editer += "0";
					break;
				case '1':
					editer += "1";
					break;
				case 'B':
					if(editer.length() == 0) {break;}
					editer = editer.substring(0,editer.length()-1);
			}
		}
		
		System.out.println(editer);
		sc.close();
		
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String keyboard = sc.next();
		char[] keychars = keyboard.toCharArray();
		
		String editer = "";
		for(char c:keychars) {
			switch(c) {
				case '0':
					editer += "0";
					break;
				case '1':
					editer += "1";
					break;
				case 'B':
					if(editer.length() == 0) {break;}
					editer = editer.substring(0,editer.length()-1);
			}
		}
		
		System.out.println(editer);
		sc.close();
		
	} main {
		Scanner sc = new Scanner(System.in);
		String keyboard = sc.next();
		char[] keychars = keyboard.toCharArray();
		
		String editer = "";
		for(char c:keychars) {
			switch(c) {
				case '0':
					editer += "0";
					break;
				case '1':
					editer += "1";
					break;
				case 'B':
					if(editer.length() == 0) {break;}
					editer = editer.substring(0,editer.length()-1);
			}
		}
		
		System.out.println(editer);
		sc.close();
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String keyboard = sc.next(); keyboard sc.next() sc.next sc char[] keychars = keyboard.toCharArray(); keychars keyboard.toCharArray() keyboard.toCharArray keyboard String editer = ""; editer "" for(char c:keychars) {
			switch(c) {
				case '0':
					editer += "0";
					break;
				case '1':
					editer += "1";
					break;
				case 'B':
					if(editer.length() == 0) {break;}
					editer = editer.substring(0,editer.length()-1);
			}
		} char c keychars {
			switch(c) {
				case '0':
					editer += "0";
					break;
				case '1':
					editer += "1";
					break;
				case 'B':
					if(editer.length() == 0) {break;}
					editer = editer.substring(0,editer.length()-1);
			}
		} {
			switch(c) {
				case '0':
					editer += "0";
					break;
				case '1':
					editer += "1";
					break;
				case 'B':
					if(editer.length() == 0) {break;}
					editer = editer.substring(0,editer.length()-1);
			}
		} switch(c) {
				case '0':
					editer += "0";
					break;
				case '1':
					editer += "1";
					break;
				case 'B':
					if(editer.length() == 0) {break;}
					editer = editer.substring(0,editer.length()-1);
			} c case '0': '0' case '0': editer += "0" editer "0" break; case '1': '1' case '1': editer += "1" editer "1" break; case 'B': 'B' case 'B': if(editer.length() == 0) {break;} editer.length() == 0 editer.length() editer.length editer 0 {break;} break; editer = editer.substring(0,editer.length()-1) editer editer.substring(0,editer.length()-1) editer.substring editer 0 editer.length()-1 editer.length() editer.length editer 1 System.out.println(editer) System.out.println System.out System System.out editer sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String keyboard = sc.next();
		char[] keychars = keyboard.toCharArray();
		
		String editer = "";
		for(char c:keychars) {
			switch(c) {
				case '0':
					editer += "0";
					break;
				case '1':
					editer += "1";
					break;
				case 'B':
					if(editer.length() == 0) {break;}
					editer = editer.substring(0,editer.length()-1);
			}
		}
		
		System.out.println(editer);
		sc.close();
		
	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String keyboard = sc.next();
		char[] keychars = keyboard.toCharArray();
		
		String editer = "";
		for(char c:keychars) {
			switch(c) {
				case '0':
					editer += "0";
					break;
				case '1':
					editer += "1";
					break;
				case 'B':
					if(editer.length() == 0) {break;}
					editer = editer.substring(0,editer.length()-1);
			}
		}
		
		System.out.println(editer);
		sc.close();
		
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String keyboard = sc.next();
		char[] keychars = keyboard.toCharArray();
		
		String editer = "";
		for(char c:keychars) {
			switch(c) {
				case '0':
					editer += "0";
					break;
				case '1':
					editer += "1";
					break;
				case 'B':
					if(editer.length() == 0) {break;}
					editer = editer.substring(0,editer.length()-1);
			}
		}
		
		System.out.println(editer);
		sc.close();
		
	}

}