a=list(eval(input()))

from collections import deque

d=deque()

for i in a:

    if i=="0" or i=="1":

        d.append(i)

    else:

        if len(d)==0:

            continue

        d.pop()

print((''.join(list(d))))
s=list(eval(input()))

from collections import deque

d=deque()

for i in s:

    if i=="0":

        d.append(i)

    elif i=="1":

        d.append(i)

    else:

        if len(d)>0:

            d.pop()

print((''.join(list(d))))
a = list(eval(input()))
from collections import deque

d = deque()
for i in a:
    if i == "0" or i == "1":
        d.append(i)
    else:
        if len(d) == 0:
            continue
        d.pop()
print(("".join(list(d))))

s = list(eval(input()))
from collections import deque

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

-a = list(eval(input())) +s = list(eval(input())) -for i in a: -    if i == "0" or i == "1": +for i in s: +    if i == "0": +        d.append(i) +    elif i == "1": -        if len(d) == 0: -            continue -        d.pop() +        if len(d) > 0: +            d.pop()