s = list(eval(input()))



ans = ""



for i in s:

  if i == "0":

    ans += "0"

  elif i == "1":

    ans += "1"

  else:

    try:

      ans = ans[:-1]

    except:

      continue



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



ans = ""



for i in s:

    if i == "0":

        ans += i

    elif i == "1":

        ans += i

    else:

        ans = ans[:-1]

        

print(ans)
s = list(eval(input()))
ans = ""
for i in s:
    if i == "0":
        ans += "0"
    elif i == "1":
        ans += "1"
    else:
        try:
            ans = ans[:-1]
        except:
            continue
print(ans)

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

-s = list(eval(input())) +s = eval(input()) -        ans += "0" +        ans += i -        ans += "1" +        ans += i -        try: -            ans = ans[:-1] -        except: -            continue +        ans = ans[:-1]