import java.util.*

fun main(args:Array<String>){
    val s = readLine()!!
    var ans = ArrayDeque<Char>()
    for(i in 0 until s.length){
        if(s[i] == '0') ans.addLast('0')
        else if(s[i] == '1') ans.addLast('1')
        else{
            if(ans.isNotEmpty()) ans.removeLast()
        }
    }
    ans.forEach(){
        print(it)
    }
    println()
}
