s=eval(input())

ans=''

for i in s:

    if i=='0' or i=='1':

        ans+=i

    else:

        ans=ans[:-1]



print(ans)
s=eval(input())

ans=''

for i in range(len(s)):

    a=s[i]

    if a=='0':

        ans+='0'

    elif a=='1':

        ans+='1'

    else:

        if len(ans)!=0:

            ans=ans[:-1]



print(ans)
s = eval(input())
ans = ""
for i in s:
    if i == "0" or i == "1":
        ans += i
    else:
        ans = ans[:-1]
print(ans)

s = eval(input())
ans = ""
for i in range(len(s)):
    a = s[i]
    if a == "0":
        ans += "0"
    elif a == "1":
        ans += "1"
    else:
        if len(ans) != 0:
            ans = ans[:-1]
print(ans)

-for i in s: -    if i == "0" or i == "1": -        ans += i +for i in range(len(s)): +    a = s[i] +    if a == "0": +        ans += "0" +    elif a == "1": +        ans += "1" -        ans = ans[:-1] +        if len(ans) != 0: +            ans = ans[:-1]