s=list(eval(input()))

a=''

for i in s:

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

    a+=i

  else:

    if len(a)!=0:

      a=a[:len(a)-1]

print(a)
# 入力

s=eval(input())



a=''

for x in s:

  if x=='0':

    a+='0'

  elif x=='1':

    a+='1'

  else:

    # 文字列が空でない場合、末尾を削除

    if a!='':

      a=a[:-1]



# 出力

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

# 入力
s = eval(input())
a = ""
for x in s:
    if x == "0":
        a += "0"
    elif x == "1":
        a += "1"
    else:
        # 文字列が空でない場合、末尾を削除
        if a != "":
            a = a[:-1]
# 出力
print(a)

-s = list(eval(input())) +# 入力 +s = eval(input()) -for i in s: -    if i == "0" or i == "1": -        a += i +for x in s: +    if x == "0": +        a += "0" +    elif x == "1": +        a += "1" -        if len(a) != 0: -            a = a[: len(a) - 1] +        # 文字列が空でない場合、末尾を削除 +        if a != "": +            a = a[:-1] +# 出力