function Main(input) {
  var output = '';
  for (var i = 0; i < input.length; i++) {
    if (input[i] == '0') {
      output += '0';
    } else if (input[i] == '1') {
      output += '1';
    } else {
      output = output.slice(0, -1);
    }
  }
  console.log(output);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));