"use strict";
const main = arg => {
  arg = arg.split('\n')[0].split('');
  let output = '';
  arg.forEach((t) => {
    if( t==0 || t==1 ){
    	output += t;
    } else {
    	output = output.slice(0,-1);
    }
  });
  console.log(output);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
