PROGRAM ATCODER
implicit none
character(len=10) :: s, ans
character :: a,b
integer :: i,len
  
read(*,*) s

ans = ""
a = "0"
b = "1"

len = len_trim(s)
do i = 1, len
	if (s(i:i) == a) then
    	ans = trim(ans) // a
    else if(s(i:i) == b) then
    	ans = trim(ans) // b
    else if(s(i:i) == "B") then
        ans = ans(1:len_trim(ans)-1)
    end if
end do

write(*,'(a)') trim(ans)

END PROGRAM ATCODER