Problem:
 Score : 200 points    Problem Statement Sig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.  To begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:   The 0 key: a letter 0 will be inserted to the right of the string.  The 1 key: a letter 1 will be inserted to the right of the string.  The backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.   Sig has launched the editor, and pressed these keys several times. You are given a string s , which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?      Constraints  1 ≦ |s| ≦ 10 ( |s| denotes the length of s )  s consists of the letters 0 , 1 and B .  The correct answer is not an empty string.         Input The input is given from Standard Input in the following format:  s       Output Print the string displayed in the editor in the end.        Sample Input 1 01B0      Sample Output 1 00  Each time the key is pressed, the string in the editor will change as follows: 0 , 01 , 0 , 00 .       Sample Input 2 0BB1      Sample Output 2 1  Each time the key is pressed, the string in the editor will change as follows: 0 , (empty) , (empty) , 1 .

Solution (Python):
s = input()
N = len(s)
ans = ''
for i in range(N):
    if s[i]=='B':
        ans = ans[:-1]
    else:
        ans = ans+s[i]
print(ans)

Solution (Python):
s=input()
ans = []
for i in range(len(s)):
    ans.append(s[i])
j=1
while True:
    if ans[0]=="B":
        ans.pop(0)
    elif j>=len(ans):
        break
    elif ans[j]=="B":
        ans.pop(j-1)
        ans.pop(j-1)
        j-=1
    else:
        j+=1
print(*ans,sep="")

Solution (Python):
s = input()
ans = ""
for e in s:
    if e == "0":
        ans += "0"
    elif e == "1":
        ans += "1"
    else:
        if len(ans) > 0:
            ans = ans[:-1]
print(ans)

Solution (Python):
s = input()
ans = ""
for e in s:
    if e == "0":
        ans += "0"
    elif e == "1":
        ans += "1"
    else:
        if len(ans) > 0:
            ans = ans[:-1]
print(ans)

Solution (Python):
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass

s = l()
moji = ""
for i in range(len(s)):
    if s[i] == "0":
        moji = moji + "0"
    elif s[i] == "1":
        moji = moji + "1"
    else:
        moji = moji[:-1]
print(moji)

Solution (Python):
s=input()
t=[]
for i in s:
    if i=="0":
        t.append(0)
    elif i=="1":
        t.append(1)
    else:
        if len(t)>0:
            t.pop(-1)
print(*t,sep="")

Solution (Python):
s = input()

t = ""
for i in s:
    if i == "B":
        if t:
            t = t[:-1]
    else:
        t += i

print(t)

Solution (Python):
s = input()

ans = []

for i in s:
    if i == "0":
        ans.append("0")
    elif i == "1":
        ans.append("1")
    elif i == "B" and len(ans) == 0:
        ans
    else:
        ans.pop()
print("".join(ans))

Solution (Python):
s = input()
ans = ''
for i in range(len(s)):
    if s[i] == 'B':
        ans = ans[:len(ans)-1]
    else:
        ans += s[i]
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
ans = []
s = list(input().rstrip())
for i in s:
    if i == "0":
        ans.append("0")
    elif i == "1":
        ans.append("1")
    elif len(ans) > 0:
        ans.pop()
print("".join(ans))

Solution (Python):
s=input()
x=''
for i in range(len(s)):
  if s[i]=='0':
    x=x+'0'
  elif s[i]=='1':
    x=x+'1'
  elif s[i]=='B':
    x=x[:-1]
print(x)

Solution (Python):
s = input()
ans = []

for i in range(len(s)):

	if s[i] == "B" and len(ans) >= 1:
		ans.pop(-1)
	elif s[i] == "0":
		ans.append("0")
	elif s[i] == "1":
		ans.append("1")

print("".join(ans))

Solution (Python):
comlist = list(input())
a = []

for i in comlist:
  if i == "B":
    if not len(a) == 0:
      del a[-1]
  else:
    a.append(i)


print("".join(a))

Solution (Python):
t = ""
s = input()
for i in s:
  if i == 'B' and len(t) > 0:
    t = t[:-1]
  elif i != 'B':
    t += i
print(t)

Solution (Python):

from collections import deque

s = list(input())

ans = deque()
for i in s:
    if i == "0":
        ans.extend("0")
    elif i == "1":
        ans.extend("1")
    else:
        if len(ans) == 0:
            pass
        else:
            ans.pop()



print("".join(ans))

Solution (Python):
s = str(input())
lst = []

for i in range(len(s)):
    if s[i]=='B':
        if len(lst)!=0:
            del lst[-1]
        else:
            continue
    else:
        for j in range(2):
            if int(s[i])==j:
                lst.append(str(j))

print(''.join(lst))

Solution (Python):

s = input()

res = ""
for c in s:
    if c=="B" and len(res)>0:
        res = res[:-1]
    elif c!="B":
        res += c

print(res)

Solution (Python):
s = list(input())

sStack = []

for ts in s:
  if ts == 'B':
    
    if sStack:
      sStack.pop()
  else:
    sStack.append(ts)

print(''.join(sStack))

Solution (Python):
s=input()

n=""
for i in s:
  if i in ["0","1"]:
    n=n+i
  elif i=="B" and n=="":
    pass
  else:
    n=n[0:-1]

print(n)

Solution (Python):
S = list(input())
stuck = []

for s in S:
    if s != 'B':
        stuck.append(s)
    elif s == 'B' and len(stuck) != 0:
        stuck.pop()

print(*stuck, sep='')

Solution (Python):
s=input()
ans=""
for i in s:
  if ans =="" and i=="B":
    continue
  elif ans != "" and i == "B":
    ans = ans[:-1]
  else:
    ans += i
print(ans)

Solution (Python):
s = list(input())
ans = []
for i in s:
    if i == 'B' and len(ans):
        ans.pop()
    elif i == '1':
        ans.append('1')
    elif i == '0':
        ans.append('0')
print(*ans, sep="")

Solution (Python):
s = str(input())

ans = ''
for i in range(len(s)):
    if s[i] == '1':
        ans = ans + '1'
    elif s[i] == '0':
        ans = ans + '0'
    elif s[i] == 'B':
        if len(ans) >= 2:
            ans = ans[:-1]
        else:
            ans = ''

print(ans)

Solution (Python):
s = input()

ans = ''
for i in s:
    if i == 'B':
        ans = ans[:-1]
    else:
        ans = ans + i

print(ans)

Solution (Python):
kekka = ""

for i in input():
    
    if i=="B":
        kekka=kekka[:-1]

    else:
        kekka=kekka+i
    
print(kekka)

Solution (Python):
s = list(str(input()))

kekka = []

for i in range(len(s)):
    
    if s[i]!="B":
        kekka.append(s[i])

    elif kekka!=[]:
        kekka.pop()
    
print(''.join(kekka))

Solution (Python):
ans = ""
for x in input():
    if x == "B":
        ans = ans[:-1]
    else:
        ans += x
print(ans)

Solution (Python):
s = input()
ans = ""
for a in s:
    if a == "B":
        if len(ans) != 0:
            ans = ans[:-1]
    else:
        ans += a
print(ans)

Solution (Python):
s = input()
ans = []
for a in s:
	if a == 'B':
		if len(ans) != 0:
			ans.pop()
	else:
		ans.append(a)
print(*ans,sep='')

Solution (Python):
s = input()
ans = [None]*len(s)
n = 0
for c in s:
    ans[n] = c
    n += 1
    if c=='B': n = max(0, n-2)
print(*ans[:n], sep='')

Solution (Python):
ans = ""
for s in input():
    if s == "B":
        ans = ans[:-1]
    else:
        ans += s
print(ans)

Solution (Python):
s = list(map(str,input()))
ans = ""
count = 0
for i in s:
    if i == "0":
        ans += "0"
        count += 1
    elif i == "1":
        ans += "1"
        count += 1
    else:
        if count == 0 :
            continue
        else:
            ans = ans[:-1]
            count+=1
print(ans)

Solution (Python):
S = input()
ans = []
for i in S:
    if i == '1': ans.append('1')
    if i == '0': ans.append('0')
    if i == 'B':
        if 0 < len(ans): ans.pop()
print(''.join(ans))

Solution (Python):
s = input()
s_list = [s[_] for _ in range(len(s))]

output = list()
for c in s_list:
  if c == '0':
    output.append('0')
  elif c == '1':
    output.append('1')
  else:
    if len(output) > 0:
      output.pop()
print(''.join(output))

Solution (Python):
s=[i for i in input()]
e=[]
for i in s:
  if i=="0":
    e.append("0")
  elif i=="1":
    e.append("1")
  else:
    if e:
      e.pop(-1)
print("".join(e))

Solution (Python):
S = input()

ans = ""
for i in range(len(S)):
    if S[i] == "B":
        if ans == "":
            pass
        else:
            ans = ans[:-1]
    elif S[i] == "0":
        ans += "0"
    elif S[i] == "1":
        ans += "1"

print(ans)

Solution (Python):

a = input()

ans = []
for c in a:
    if c != "B": 
        ans.append(c)
    else:
        if len(ans) != 0 :ans.pop()
 
print("".join(ans))

Solution (Python):
s = input()
ans = ""

for c in s:
    if c != "B":
        ans += c
    else:
        ans = ans[:-1]

print(ans)

Solution (Python):
s = input()
ans = []
for c in s:
    if c != "B":
        ans.append(c)
    else:
        if len(ans) != 0 :ans.pop()

print("".join(ans))

Solution (Python):
d=""
for s in input():
    if s=="B":d=d[:-1]
    else:d+=s
print(d)

Solution (Python):
s=str(input())
list =[]
for i in range(len(s)):
  if s[i]=='B':
    list = list[0:-1]
  else:
    list +=s[i]
k=''
for i in range(len(list)):
  k +=list[i]
print(k)

Solution (Python):
s=list(input())
a=[]
for i in range(len(s)):
    if s[i]=='0' or s[i]=='1':
        a.append(s[i])
    elif len(a)>0:
        del a[len(a)-1]

print(''.join(a))

Solution (Python):
s=list(input())

ans=[]
for i in range(len(s)):
    if s[i] == "0":
        ans.append(s[i])
    elif s[i] == "1":
        ans.append(s[i])
    if s[i] == "B" and ans !=[]:
        ans.pop(-1)
    
print(*ans, sep="")

Solution (Python):
s = input()

ans = []
for x in s:
   if (x == '0'):
      ans.append('0')
   elif (x == '1'):
      ans.append('1')
   elif (x == 'B' and len(ans) > 0):
      ans.pop(-1)

print(''.join(ans))

Solution (Python):
s = input()
S = list(s)
ans = []
for i in range(len(s)):
    if S[i] == 'B':
        if ans:
            ans.pop()
    else:
        ans.append(S[i])
print(''.join(ans))

Solution (Python):
def typing(s, ans):
    for i in range(len(s)):
        if s[i] == 'B' and len(ans) == 0:
            continue
        else:
            if s[i] == '0':
                ans.append('0')
            elif s[i] == '1':
                ans.append('1')
            elif s[i] == 'B':
                ans.pop()

    print(''.join(ans))

S = str(input())
ANS = []
typing(S, ANS)

Solution (Python):
def typing(s, ans):
    for i in range(len(s)):
        if s[i] == '0':
            ans.append('0')
        elif s[i] == '1':
            ans.append('1')
        elif s[i] == 'B' and len(ans) != 0:
            ans.pop()
        else:
            continue

    print(''.join(ans))

S = str(input())
ANS = []
typing(S, ANS)

Solution (Python):
def typing(s, ans):
    for i in range(len(s)):
        if s[i] == '0':
            ans += '0'
        if s[i] == '1':
            ans += '1'
        if s[i] == 'B' and ans != '':
            ans = ans[:len(ans)-1]

    print(ans)

S = str(input())
ANS = ''
typing(S, ANS)

Solution (Python):
sl = list(input())

ans = []

for s in sl:
   if s != "B":
      ans.append(s)
   else:
      if len(ans) > 0:
         ans.pop()

print("".join(ans))

Solution (Python):

 
import math
import itertools
import sys
import copy
 


s = str(input())

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

print (ans)

Solution (Python):
s=input()
str=""

for item in s:
  if item=="0":
    str+="0"
  elif item=="1":
    str+="1"
  else:
    if len(str)>0:
      str=str[0:-1]
    else:
      pass
    
print(str)

Solution (Python):
s = input()
m = []
for i in s:
    if i == "0":
        m.append(i)
    elif i == "1":
        m.append(i)
    else:
        try:
            m.pop(-1)
        except:
            continue
answer = "".join(m)
print(answer)

Solution (Python):
S=input()
stack =[]
for s in S:
    if not stack and s=='B':
      
      
      continue
    elif s=='B':
        stack.pop()
    else:
        stack.append(s)

print(''.join(stack))

Solution (Python):
s = list(str(input()))

kekka = []

for i in range(len(s)):
    
    if s[0]=="B":
        pass
            
    if s[i]=="B" :
        if not kekka==[]:
            kekka.pop()
    else:
        kekka.append(s[i])

print(''.join(kekka))

Solution (Python):
s = list(str(input()))

kekka = []

for i in range(len(s)):
    
    if s[0]=="B":
        pass
            
    if s[i]=="B" :
        if not kekka==[]:
            kekka.pop()
    else:
        kekka.append(s[i])

print(''.join(kekka))

Solution (Python):
S = input()
ans = []
for s in S:
  if s == "0":
    ans.append("0")
  if s == "1":
    ans.append("1")
  if len(ans)!=0 and s == "B":
    ans.pop()
print("".join(ans))

Solution (Python):
*s, = input()
ans = []
for x in s:
    if x == '0':
        ans.append('0')
    elif x == '1':
        ans.append('1')
    else:
        if ans:
            ans.pop()
print(''.join(ans))

Solution (Python):
input_str = input()
s = ''
for c in input_str:
    if c == 'B':
        s = s[:-1]
    else:
        s += c
print(s)

Solution (Python):
import math
import fractions

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

Solution (Python):
s = input()

ans = ''

for i in range(len(s)):
	if s[i] == '0':
		ans += '0'
	elif s[i] == '1':
		ans += '1'
	elif s[i] == 'B':
		if len(s) >= 1:
			ans = ans[:-1]

print(ans)

Solution (Python):

import sys


def main(argv=sys.argv):
  
  code = list(input())
  list1 = []
  
  for i in range(len(code)):
    if code[i] == '0':
      list1.append(0)
      
    elif code[i] == '1':
      list1.append(1)
      
    elif len(list1) == 0 and code[i] == 'B':
      pass
      
    elif code[i] == 'B':
      list1.pop(-1)     
      
  print(''.join(map(str, list1)))
    
  
  return 0


if __name__ == '__main__':
  sys.exit(main())

Solution (Python):
s = input()

ans =''

for x in s:
    if x == '0':
        ans += '0'
    elif x == '1':
        ans += '1'
    else:
        if ans != '':
            ans = ans[:-1]

print(ans)

Solution (Python):

import sys


def main(argv=sys.argv):

    inputs_ = list(input())

    string_ = []

    for input_ in inputs_:

        if input_ == 'B':

            if not string_ == []:

                string_.pop(-1)

        else:

            string_.append(input_)

    print(''.join(string_))

    return 0


if __name__ == '__main__':
    sys.exit(main())

Solution (Python):
S = input()
ans = ""
for i in S:
  if i == "B":
    ans = ans[:-1]
  else:
    ans += i
print(ans)

Solution (Python):

import sys


def main(argv=sys.argv):
  
    inputs_ = list(input())

    string_ = []

    for input_ in inputs_:

        if input_ == 'B':

            if not string_ == []:
              
                string_.pop(-1)

        else:

            string_.append(input_)

    print(''.join(string_))

    return 0


if __name__ == '__main__':
    sys.exit(main())

Solution (Python):
s = input()
output = ""

for i in s:
  
  if (output == "") and (i == "B"):
    pass
  elif i == "0":
    output = output + "0"
  elif i == "1":
    output = output + "1"
  elif i == "B":
    output = output[:-1]

print(output)

Solution (Python):
s = input()
ans = ''
for x in s:
  if x != 'B':
    ans += x
  elif x == 'B' and x != '':
    ans = ans[:-1]
  else:
    continue
print(ans)

Solution (Python):
s=input()

answer=""

for c in s:
  if c != "B":
    answer += c
  elif answer != "":
    answer = answer[:-1]
  else:
    continue
print(answer)

Solution (Python):
s = input()
ans = ""
for i in s:
  if i == "B":
    ans = ans[:-1]
  else:
    ans += i
print(ans)

Solution (Python):
s = input()
out = ""

for i in s:
    if i == "0" or i == "1":
        out += i
    else:
        out = out[:-1]

print(out)

Solution (Python):
s = input()
l = list(s)
i = 0
r = []
while i < len(l):
    if len(r) == 0:
        if s[i] == 'B':
            pass
        else:
            r.append(s[i])
    else:
        if s[i] == 'B':
            r.pop()
        else:
            r.append(s[i])
    i += 1
print(''.join(r))

Solution (Python):
S = list(input())
final_str = []
for key in S: 
    if key == "B":
      final_str = final_str[:-1]
    else:
      final_str.append(key)
print(''.join(final_str))

Solution (Python):
s=input()
temp=''
for i in s:
    if i!='B':
        temp+=i
    else:
        temp=temp[:len(temp)-1]
print(temp)

Solution (Python):
S = input()
text = ""
for s in S:
  if(s=="1" or s=="0"):
    text = text + s
  else:
    text = text[:len(text)-1]
print(text)

Solution (Python):
s = input()

ans = ""

for i in s:
    if i == "0":
        ans += i
    elif i == "1":
        ans += i
    else:
        if ans:
            ans = ans[:-1]

print(ans)

Solution (Python):
s=list(input())
ans=[]
for i in range(len(s)):
  if s[i]== 'B':
    if len(ans)>0:
      ans.pop()
  else:
    ans.append(s[i])

print(''.join(ans))

Solution (Python):
s = input()
ans =''
for si in s:
  if si =='B':
    ans = ans[:-1]
  else:
    ans += si
print(ans)

Solution (Python):
s = input()

ans = []
for x in s:
    if x == '0' or x == '1':
        ans.append(x)
    elif x == 'B' and ans:
        ans.pop()
print(''.join(ans))

Solution (Python):
hoge=input()
ans=''
for i in hoge:
  if i == 'B':
    l=len(ans)
    ans=ans[0:l-1]     
  else:
    ans=ans+i
print(ans)

Solution (Python):
hoge=input()
n=len(hoge)
ans=''
for i in hoge:
  if i == 'B':
    l=len(ans)
    if l==0:
      pass
    else:
      ans=ans[0:l-1]     
  else:
    ans=ans+i
print(ans)

Solution (Python):
s = input()
out = ""
for i in range(len(s)):
	if s[i] == "0" or s[i] == "1":
		out += s[i]
	else:
		out = out[:-1]
print (out)

Solution (Python):
s = str( input() )
sol = ""
for i in range( len(s) ) :
   if s[i]!="B" :
      sol = sol + str( s[i] )
   elif len(sol) != 0 :
      sol = sol[:len(sol)-1]

print( sol )

Solution (Python):


s = input().upper()

edited = []

for c in s:
  if c == "0" :
    edited.append("0")
  elif c == "1" : 
    edited.append("1")
  elif c == "B" :
    if len(edited) > 0:
      edited.pop()

print("".join(map(str, edited)))

Solution (Python):

s = input()
s = list(s)

ans = []

for i in range(len(s)):
    if s[i] == "0":
        ans.append("0")
    elif s[i] == "1":
        ans.append("1")
    elif s[i] == "B":
        if len(ans) != 0:
            ans.pop()
print("".join(ans))

Solution (Python):
s = list(input())
ans = []
for i in s:
  if i == "0":
    ans.append(i)
  elif i == "1":
    ans.append(i)
  else:
    if len(ans) != 0:
      ans.pop()
print("".join(ans))

Solution (Python):
s = input()
ans = ''
for i in s:
    if i == 'B' and not ans:
        pass
    elif i == 'B' and ans:
        ans = ans[:-1]
    else:
        ans += i
        
print(ans)

Solution (Python):

s = input()
out = []
for i in s:
  if i != "B":
    out.append(i)
  else:
    if len(out) != 0:
      out = out[:-1]
print("".join(out))

Solution (Python):


s = input()
ans = ""
for c in s:
    if c in ["0", "1"]:
        ans += c
    elif ans:
        ans = ans[:-1]

print(ans)

Solution (Python):
s=input()
while 1:
    for i in range(len(s)):
        if s[i]=="B":
            if 0<i<len(s):
                s = s[:i-1]+s[i+1:]
                break
            elif i==len(s):
                s = s[:i]
            else:
                s = s[1:]
                break
    else:
        print(s)
        break

Solution (Python):

s = input()

answer = ''
for i in s:
    if i == '1' or i == '0':
        answer += i
    elif len(answer) > 0:
        answer = answer[:-1]

print(answer)

Solution (Python):
s=list(input())
t=[]
for i in s:
  if i=="0":
    t.append("0")
  elif i=="1":
    t.append("1")
  else:
    if t==[]:
      pass
    else:
      t.pop()
mojiretsu = ''.join(t)
print (mojiretsu)

Solution (Python):
s = input()
ans = []
for i in s:
    if i != "B":
        ans.append(i)
        continue
    if len(ans) == 0:
        continue
    elif len(ans) != 0:
        ans.pop()
print(*ans, sep="")

Solution (Python):


s = input()
word = ''

for i in range(len(s)):
    if s[i] == '0':
        word = word + '0'
    elif s[i] == '1':
        word = word + '1'
    else:
        if len(word) != 0:
            word = word[:-1]

print(word)

Solution (Python):
words=input()
s=""
for word in words:
    if word=="B":
        s=s[:-1]
    else:
        s=s+word
print(s)

Solution (Python):
S = input()
ans = []
for s in S:
    if s == "B":
        if ans:
            ans.pop(-1)
    else:
        ans.append(s)

print("".join(ans))

Solution (Python):
S = input()
ans = ''
for s in S:
  if s == 'B':
    ans = ans[:-1]
  else:
    ans += s
print(ans)

Solution (Python):
a = list(input())
s = []
for i in a:
    if i == 'B':
        if s == []:
            pass
        else:
            s.pop(-1)
    else:
        s.append(i)
print(''.join(s))

Solution (Python):
s=input()
while s.count('B')>=1:
  s=s.replace('1B','')
  s=s.replace('0B','')
  if s[0]=='B':
    s=s[1:]




print(s)

Solution (Python):
set = input()
words = []
for i in range(len(set)):
    if set[i] == "0":
        words.append("0")
    if set[i] == "1":
        words.append("1")
    if set[i] == "B":
        try:
            words.pop(-1)
        except:
            pass
word = ""
for i in words:
    word += i
print(word)

Solution (Python):
s = input()

r = ''
for c in s:
    if c == '0':
        r += '0'
    elif c == '1':
        r += '1'
    elif c == 'B':
        r = r[0:-1]

print(r)

Solution (Python):
import sys

commands = sys.stdin.readline().rstrip()

def main():
    res = []
    for c in commands:
        if c == 'B':
            if res:
                res.pop()
        else:
            res.append(c)
    return ''.join(res)
            
if __name__ == '__main__':
    ans = main()
    print(ans)

Solution (Python):
s = input()

r = ''
for c in s:
    if c == '0':
        r += '0'
    elif c == '1':
        r += '1'
    elif c == 'B':
        r = r[0:-1]

print(r)

Solution (Python):
s = list(input())
ans = []
answer = ''


for i in range(len(s)):
    if s[i] == '0':
        ans.append(0)
    elif s[i] == '1':
        ans.append(1)
    else:
        if len(ans) == 0:
            continue
        else:
            del ans[-1]

for i in range(len(ans)):
    answer = answer + str(ans[i])
print(answer)

Solution (Python):
s = list(input())
ans = []
answer = ''


for i in range(len(s)):
    if s[i] == '0':
        ans.append(0)
    elif s[i] == '1':
        ans.append(1)
    else:
        if len(ans) == 0:
            continue
        else:
            del ans[-1]

for i in range(len(ans)):
    answer = answer + str(ans[i])
print(answer)

Solution (Python):
s=input()
ls=[]
for i in range(len(s)):
  if s[i]!="B":
    ls.append(s[i])
  elif ls!=[]:
    del ls[-1]
print(*ls,sep="")

Solution (Python):
s = input()
t = ""
for c in s:
  if c == "B":
    if t != "":
      t = t[:len(t)-1]
  else:
    t += c
print(t)

Solution (Python):
s = input()
li = []

def push_0(li):
    li.append(0)

def push_1(li):
    li.append(1)

def push_Back(li):
    if li == []:
        a = 1
    else:
        li.pop(-1)

for i in s:
    if i == '0':
        push_0(li)
    elif i == '1':
        push_1(li)
    else:
        push_Back(li)

for i in li:
    print(i, end='')

Solution (Python):
s=input()
ans=[]
for a in s:
    if a=='B':
        if ans==[]:
            continue
        else:
            ans=ans[0:-1]
    else:
        ans.append(a)
print(''.join(ans))

Solution (Python):
s = input()
ans = []

for a in s:
    if a == '0':
        ans.append('0')
    elif a == '1':
        ans.append('1')
    else:
        if ans != []:
            ans.pop(-1)

print(''.join(ans))

Solution (Python):
s = list(input())
ans = []
for i in range(0,len(s)):
    if s[i] == "B":
        if ans != []: ans.pop()
    else:
        ans.append(s[i])

print("".join(ans))

Solution (Python):
S = input()

S_2 = list(S)



ans = []

for i in range(len(S_2)):
    if S_2[i] == "0":
        ans.append("0")
    elif S_2[i] == "1":
        ans.append("1")
    elif S_2[i] == "B" and len(ans) !=0:
        del ans[-1]

for i in ans:
    print(i,end = "")

Solution (Python):




S = input()

result=[]
for i in range(len(S)):
    if S[i]=="0":
        result.append("0")
    elif S[i]=="1":
        result.append("1")
    elif S[i]=="B":
        if result != []:
            result.pop()
        
print("".join(result))

Solution (Python):
from collections import deque
s = deque(list(input()))
editor = deque()
while s:
  x = s.popleft()
  if x == "0":
    editor.append("0")
  elif x == "1":
    editor.append("1")
  elif x == "B" and len(editor) != 0:
    editor.pop()
print("".join(editor))

Solution (Python):
s = str(input())
s_list = list(map(str, s))
result = ""
for i in range(len(s_list)) :
  if s_list[i] == "1" or s_list[i] == "0" :
    result += s_list[i]
  else:
    result = result[:-1]
print(result)

Solution (Python):
S = input()

ans = []
for s in S:
    if s == '0':
       ans.append('0')
    elif s == '1':
        ans.append('1')
    elif s == 'B':
        if len(ans) > 0:
            ans.pop()

print(''.join(ans))

Solution (Python):
s = list(str(input()))
ln = []
for i in range(len(s)):
    if s[i] == '0':
        ln.append(s[i])
    if s[i] == '1':
        ln.append(s[i])
    if s[i] == 'B':
        if len(ln) != 0:
            ln.pop()
print(''.join(ln))

Solution (Python):
s = list(input())
ans = ""
for i in s:
    if i == "0" or i == "1":
        ans += i
    else:
        if len(ans) == 0: continue
        else: ans = ans[0:len(ans)-1]
print(ans)

Solution (Python):
s = input()
a = [] 

for i in range(len(s)):
    if s[i] in '01':
        a.append(s[i])
    elif(len(a) > 0):
        a.pop(-1)
print(''.join(a))

Solution (Python):
s_list = list(input())
ans = []
for s in s_list:
  if s == '0' or s == '1':
    ans.append(s)
  elif s == 'B' and len(ans) > 0:
    ans.pop()

print(*ans, sep='')

Solution (Python):
ans=""
s=input()
for i in range(len(s)):
    if s[i]=="B":
        ans=ans[:-1]
    else:
        ans+=s[i]
print(ans)

Solution (Python):
s=input()
a = []
for i in range(len(s)):
    if s[i] == "0":
        a.append("0")
    elif s[i] == "1":
        a.append("1")
    elif s[i] == "B":
        if len(a) == 0:
            continue
        else:
            a.pop(-1)
ans = ""
for i in range(len(a)):
    ans += a[i]
print(ans)

Solution (Python):
s=list(input())
x=[]
for i in s:
    if i=='B':
        x=x[:-1]
    else:
        x.append(i)

print(''.join(x))

Solution (Python):
string = input()

answer = []

for c in string:
    if c == "B":
        if len(answer) != 0:
            answer.pop()
    else:
        answer.append(c)

print("".join(answer))

Solution (Python):



S = list(input())

R = ''
for i in S:
    if i == 'B':
        R = R[:-1]
    else:
        R = R + i

print(R)

Solution (Python):
s = input()
ans =""
for i in s:
    if i == "0" or i == "1":
        ans += i
    elif i == "B" and len(ans) != 0:
        ans = ans[:-1]
print(ans)

Solution (Python):
s = input()
res = ''
for typed in s:
    if typed == '0':
        res = res + '0'
    elif typed == '1':
        res = res + '1'
    elif typed == 'B':
        if res != '':
            res = res[0:-1] 
print(res)

Solution (Python):
s = input()
ans = ""
for i in s:
    if i == "0" or i == "1":
        ans += i
    elif i == "B" and len(ans) != 0:
        ans = ans[:-1]
print(ans)

Solution (Python):
S = list(input())

ans = ''
for s in S:
  if s == '0':
    ans += '0'
  elif s == '1':
    ans += '1'
  else:
    ans = ans[:-1]
print(ans)

Solution (Python):
s = input()
ls = []

for mozi in s:
    if mozi == '0':
        ls.append(mozi)
    elif mozi == '1':
        ls.append(mozi)
    else:
        if len(ls) > 0:
            ls.pop()

ans = ''.join(ls)

print(ans)

Solution (Python):
S = input()
ans = ''
for i in S:
    if i == 'B' and len(ans) > 0:
        ans = ans[:-1]
    elif i != 'B':
        ans += i
print(ans)

Solution (Python):
a=input()
a_l=len(a)
ans=[]
moji=""
for i in range(a_l):
    if a[i]=="0":
        ans.append("0")
    elif a[i]=="1":
        ans.append("1")
    elif a[i]=="B" and len(ans)!=0:
        del ans[len(ans)-1]
    
for i in range(len(ans)):
    moji+=ans[i]
print(moji)

Solution (Python):
s = input()

ans = ''
for i in s:
    if i != 'B':
        ans += i
    else:
        ans = ans[:-1]
print(ans)

Solution (Python):
s = input()
a = ''
for i in s:
  if i != 'B':
    a += i
  else:
    a = a[:-1]
print(a)

Solution (Python):
s = input()

ans = ""

for key in s:
    if key == "B":
        ans = ans[:-1]
    else:
        ans += key

print(ans)

Solution (Python):

import sys


def solve(s: str):
    answer = ""
    for i in range(len(s)):
        if s[i] == 'B':
            if answer:
                answer = answer[:len(answer)-1]
        else:
            answer += s[i]
    print(answer)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    s = next(tokens)  
    solve(s)

if __name__ == '__main__':
    main()

Solution (Python):
from sys import stdin

s = stdin.readline().rstrip()

li = []

for i in s:
    if i == "0" or i == "1":
        li.append(i)
    else:
        if li:
            li.pop()

print("".join(li))

Solution (Python):

if __name__ == '__main__':
    INPUT=input()
    ans=[]
    for i in INPUT:
        if i=="0":
            ans.append("0")
        elif i=="1":
            ans.append("1")
        else:
            if len(ans)>0:
                ans.pop()
    print("".join(ans))

Solution (Python):
s = input()

ans = ''

check = 0

for i in range(len(s)):
	if s[i] == '0':
		ans = ans + '0'
	elif s[i] == '1':
		ans = ans + '1'
	else:
		if ans == '':
			pass
		else:
			
			ans = ans[0:len(ans)-1]
			

print(ans)

Solution (Python):
s=input()

a=''
for x in s:
  if x=='0':
    a+='0'
  elif x=='1':
    a+='1'
  else:
    
    if a!='':
      a=a[:-1]


print(a)

Solution (Python):
s = input().strip()
ans = ""
for v in s:
    if v=="B":
        ans = ans[:-1]
    else:
        ans += v

print(ans)

Solution (Python):
s=input()

a=''
for x in s:
  if x=='0':
    a+='0'
  elif x=='1':
    a+='1'
  else:
    
    if a!='':
      a=a[:-1]


print(a)

Solution (Python):
def editString(string, button):
    if button == 'B':
        if len(string) > 0:
            string = string[:-1]
        else :
            pass
    else :
        string += button
    return string

string = ''

buttons = input()

for button in buttons:
    string = editString(string, button)
    
print(string)

Solution (Python):
s = input()

ans = ""

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

Solution (Python):
s = list(input())
try:
    bs = s.index('B')
except:
    bs=-1

while bs != -1:
    if bs == 0:
        del s[bs]
    else:
        del s[bs-1]
        del s[bs-1]
    try:
        bs = s.index('B')
    except:
        bs = -1

print(''.join(s))