const fs = require('fs')
const cin = "0100BBBBB11";//fs.readFileSync('/dev/stdin', 'utf8');

function main(cin){
    

    let a = [];
    for (let i = 0; i < cin.length; ++i){
        switch(cin[i]){
            case '0':
                a.push('0'); break;
            case '1':
                a.push('1'); break;
            case 'B':
                if (a.length > 0)
                    a.pop();
                break;
                     }
    }
    console.log(a.join(''));
}

main(cin);