'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const s = args[0][0]
	const N = s.length
	const arr = new Array()

	for (let i = 0; i < N; i++) {
		if (s[i] === '0' || s[i] === '1') {
			arr.push(s[i])
		} else {
			arr.pop()
		}
	}

	console.log(arr.join(''))
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
