fun main(args: Array<String>) {
    val s= readLine()!!
    val sb = StringBuilder()
    s.forEach { when(it){
        '1' -> sb.append(1)
        '0' -> sb.append(0)
        else -> if( sb.isNotEmpty() ) sb.delete(sb.lastIndex,sb.lastIndex+1)
    }}
    println(sb)
}