from collections import deque



s = eval(input())



res = deque()

for i in s:

    if i == "0":

        res.append("0")

    elif i == "1":

        res.append("1")

    else:

        if len(res) > 0:

            res.pop()



print(("".join(res)))
import sys



sys.setrecursionlimit(10 ** 7)

f_inf = float('inf')

mod = 10 ** 9 + 7





def resolve():

    s = eval(input())



    res = []

    for i in s:

        if i == "0":

            res.append("0")

        elif i == "1":

            res.append("1")

        else:

            if len(res) > 0:

                res.pop()



    print(("".join(res)))





if __name__ == '__main__':

    resolve()

from collections import deque

s = eval(input())
res = deque()
for i in s:
    if i == "0":
        res.append("0")
    elif i == "1":
        res.append("1")
    else:
        if len(res) > 0:
            res.pop()
print(("".join(res)))

import sys

sys.setrecursionlimit(10**7)
f_inf = float("inf")
mod = 10**9 + 7


def resolve():
    s = eval(input())
    res = []
    for i in s:
        if i == "0":
            res.append("0")
        elif i == "1":
            res.append("1")
        else:
            if len(res) > 0:
                res.pop()
    print(("".join(res)))


if __name__ == "__main__":
    resolve()

-from collections import deque +import sys -s = eval(input()) -res = deque() -for i in s: -    if i == "0": -        res.append("0") -    elif i == "1": -        res.append("1") -    else: -        if len(res) > 0: -            res.pop() -print(("".join(res))) +sys.setrecursionlimit(10**7) +f_inf = float("inf") +mod = 10**9 + 7 + + +def resolve(): +    s = eval(input()) +    res = [] +    for i in s: +        if i == "0": +            res.append("0") +        elif i == "1": +            res.append("1") +        else: +            if len(res) > 0: +                res.pop() +    print(("".join(res))) + + +if __name__ == "__main__": +    resolve()