import std.stdio, std.string,std.range, std.conv, std.array, std.algorithm, std.math, std.typecons, std.container, std.datetime;

void main() {
  auto S = readln.chomp;
  string result;
  foreach (s; S) {
    final switch (s) {
      case '0':
      case '1':
        result ~= s;
        break;
      case 'B':
        if (result.length > 0)
          result = result[0..$-1];
        break;
    }
  }
  writeln(result);
}
