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

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    string s = read!string;

    char[] buf;
    foreach (c; s) {
        switch (c) {
            case '0': buf ~= '0'; break;
            case '1': buf ~= '1'; break;
            case 'B':
                if (buf.length > 0) {
                    buf = buf[0..$-1];
                }
                break;
            default:
                break;
        }
    }
    writeln(buf);
}
