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()
output = ''
for i in range(len(s)):
    if s[i] == '0':
        output += '0'
    elif s[i] == '1':
        output += '1'
    else:
        if output == '':
            pass
        else:
            output = output[:-1]


print(output)

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

Solution (Python):
a = input()
l = []
for i in a:
    if i == "B" and len(l)>0:
        l.pop()
    elif i == "0" or i == "1":
        l.append(i)
s=''
for i in l:
    s+=i
print(s)

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

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

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

Solution (Python):
s = list(input())
ans = []
for i in range(len(s)):
    if s[i] == '0' or s[i] == '1':
        ans.append(s[i])
    else:
        if len(ans) > 0:
            ans.pop(-1)
print("".join(ans))

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

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

Solution (Python):
s_list = list(input())
res = []
for s in s_list:
    if s == 'B':
        if len(res) == 0: continue
        res.pop(-1)
    else:
        res.append(s)
print(''.join(res))

Solution (Python):
S=input()
out=''

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

Solution (Python):
s = input()

out = ''

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

print(out)

Solution (Python):
s_list = list(input())
res = []
for s in s_list:
    if s == 'B':
        if len(res)==0: continue
        res.pop(-1)
    else:
        res.append(s)
print(''.join(res))

Solution (Python):
s=input();k=[]
for i in range(0,len(s)):
    if s[i]!='B':
        k.append(int(s[i]))
    else:
        if k!=[]:
            del k[-1]
for j in range(0,len(k)):
    print(k[j],end='')
print('')

Solution (Python):

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

Solution (Python):
s=''
for c in input():s=[s+c,s[:-1]][c>'1']
print(s)

Solution (Python):
s=''
for c in input():s=[s+c,s[:-1]][c>'1']
print(s)

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')
  else:
    if(len(ans) != 0):
      ans.pop(-1)

str = ''.join(ans)
print(str)

Solution (Python):
l=[''for _ in'_'*9]
for c in input():
    if c>'1':l.pop()
    else:l.append(c)
print(''.join(l))

Solution (Python):
s = input()
ans =''
for c in s:
    if c == '0':
        ans += '0'
    elif c == '1':
        ans += '1'
    else:
        if len(s) == 0:
            continue
        else:
            ans = ans[:-1]
print(ans)

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

print(ans)

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

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

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

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

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

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

Solution (Python):
s=list(input())
ans=[]
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:
            pass
        else:
            ans.pop(-1)
print("".join(ans))

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

Solution (Python):
s = input()
stack = []
for c in s:
    if c == 'B':
        if len(stack) == 0: continue
        else: stack.pop()
    else:
        stack.append(c)
print(''.join(stack))

Solution (Python):
w = []
for c in input():
    if c == 'B':
        if len(w) != 0:w.pop()
    else:w.append(c)
print(''.join(w))

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

ans = []
for i in S:
    if i != 'B':
        ans.append(i)
    else:
        if len(ans) != 0:
            del ans[-1]

print ''.join(ans)

Solution (Python):
s = input()
ans = []
for i in s:
  if i == "B":
    try:
      ans.pop()
    except:
      pass
  else:
    ans.append(i)
print("".join(ans))

Solution (Python):
from collections import deque

s = input()

q = deque()

for c in s:
    if c == 'B':
        if q:
            q.pop()
    else:
        q.append(c)

for i in range(len(q)):
    print(q.popleft(), end='')

print()

Solution (Python):
s = list(map(str,input()))
l = []
for i in s:
    if i == '0':
       l.append(i)
    elif i == '1':
       l.append(i)
    elif  i == 'B' and len(l) != 0:
        l.pop(-1)
print(''.join(l))

Solution (Python):
s=input()

while s.replace('0B','').replace('1B','') != s:
    s=s.replace('0B', '').replace('1B', '')
print(s.replace('B',''))

Solution (Python):
s = raw_input()

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

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

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

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

print(''.join(ans))

Solution (Python):
s = input()

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

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

Solution (Python):
s = input()
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()
for a in ans:
    print(a,end="")

Solution (Python):
s = input()

res = ''

for i in range(len(s)):
    if res == '':
        if s[i] == 'B':
            pass
        else:
            res += s[i]
    else:
        if s[i] == 'B':
            res = res[:-1]
        else:
            res += s[i]
    
print(res)

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

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

Solution (Python):
STR = input()

def solve():
    res = ""
    for c in STR:
        if c == "0":
            res += "0"
        elif c == "1":
            res += "1"
        elif c == "B":
            if not len(res) == 0:
                res = res[:-1]

    return res

print(solve())

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(-1)
print(''.join(ans))

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

for i in range(len(n)):
    if n[i] == "B":
        if ans:
            ans = ans[:-1]
    else:
        ans +=n[i]

print(ans)

Solution (Python):
a,l=list(input()),[]
for s in a:
    if s =="0":l.append("0")
    elif s=="1":l.append("1")
    elif s=="B":
        if len(l)>0:
            del l[-1]
print("".join(l))

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

Solution (Python):
ans=[]
for i in input():
    if i == "0":
        ans.append("0")
    elif i == "1":
        ans.append("1")
    else:
        if len(ans) != 0:
            del ans[-1]
for i in ans:
    print(i,end="")

Solution (Python):
S = input()
str = ''

for w in S:
  if w == 'B':
    if str == '':
      continue
    else:
      str = str[:-1]
  elif w == '0':
    str += '0'
  elif w == '1':
    str += '1'
print(str)

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')
    else:
        if len(A) != 0:
            A.pop(-1)
        else:
            pass
print(''.join(A))

Solution (Python):
s = input()

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

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 a!=[]:
        a.pop()
        
print("".join(a))

Solution (Python):
A = []
for a in input():
    if a == '0' or a == '1':
        A.append(a)
    elif len(A) > 0:
        del A[-1]
print(''.join(A))

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

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

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

Solution (Python):
givenSeq = input()
list1=list(givenSeq)

index=0
while index < len(list1):
    if list1[index] == "B":
        if index!=0:
            del list1[index]
            del list1[index-1]
        else:
            del list1[index]
        index-=1
    else:
        index+=1
print("".join(list1))

Solution (Python):
import numpy as np

string = list(input())

stack = []

for s in string:
  if (s == '0' or s == '1'):
    stack.append(s)
  else:
    if len(stack) > 0:
      stack.pop()
    else:
      pass

answer = ''
for t in stack:
  answer += t

print(answer + '\n')

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

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

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

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

Solution (Python):
l_s = [a for a in input()]
l_str = ''
for a in l_s:
    if a == '0':
        l_str += ('0')
    elif a == '1':
        l_str += ('1')
    elif a == 'B':
        if l_str == '':
            pass
        else:
            l_str = l_str[:-1]

print(l_str)

Solution (Python):
s = input()
ans = []
for i in range(len(s)):
    if s[i] == '0':
        ans += '0'
    elif s[i] == '1':
        ans += '1'
    elif len(ans) != 0:
        ans = ans[:-1]
print(''.join(ans))

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

Solution (Python):
s = input()
editor = [""]
for e in s:
    if e == "0":
        editor.append("0")
    elif e == "1":
        editor.append("1")
    elif e == "B" and editor != []:
        del editor[-1]
print("".join(editor))

Solution (Python):
s = input()
ans = []
for x in s:
    if x == "0" or x == "1":
        ans.append(x)
    else:
        if len(ans) > 0:
            ans.pop()
print("".join(ans))

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

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

Solution (Python):
import sys


S = str(input())

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

print(ans)

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

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

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

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

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

b = list(a)

c = len(b)

strs = []

for i in range(c):
  if b[i] == 'B':
      strs = strs[:-1]
  else:
    strs.append(b[i])

print(''.join(strs))

Solution (Python):
def execute(s):
    r = ''
    for b in s:
        if b == 'B':
            r = r[0:-1]
        else:
            r += b
    return r


if __name__ == '__main__':
    print(execute(input()))

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

Solution (Python):
s=input()
t=[]
for i in s:
    if i=="B" and len(t)!=0:t.pop()
    if i=="0" or i=="1":t.append(i)
print(*t,sep="")

Solution (Python):
s = input()
ans = []
for c in s:
    if c == '0':
        ans.append('0')
    elif c == '1':
        ans.append('1')
    elif len(ans):
        ans.pop(-1)
print(''.join(ans))

Solution (Python):
S = input()
out = ''
for c in S:
    if c=='0' or c=='1': out += c
    else: out = out[:-1]
print(out)

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

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

Solution (Python):
s=input()
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()
print("".join(ans))

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

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

Solution (Python):
command = str(input())
N = len(command)
text = ""
for i in range(N):
    if command[i] == "1":
        text += "1"
    elif command[i] == "0":
        text += "0"
    else:
        if text  == "":
            text = text
        else:
            text = text[:-1]

print(text)

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

            t = ''.join(k)
            
print(t)

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

Solution (Python):
S = input()

ans = []
for s in S:
    if s in ["0","1"]:
        ans.append(s)
    elif s == "B" and ans != []:
        ans = ans[:-1]

print("".join(ans))

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

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

Solution (Python):
s = ''
b = 0
for i in reversed(input()):
    if i != 'B':
        if b > 0:
            b -= 1
        else:
            s += i
    else:
        b += 1

print(s[::-1])

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

print(ans)

Solution (Python):
s = input()

result = list()

for w in s:
    if w == "B":
        if len(result):
            result.pop()
    else:
        result.append(w)
print("".join(result))

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

Solution (Python):



def main():
    s = input()
    ans = ''

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

    print(ans)


if __name__ == '__main__':
    main()

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

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

Solution (Python):
s = input()
ans=[]
for i in range(len(s)):
    if(s[i] == '0' or s[i] == '1'):
        ans.append(s[i])

    else:
        if(len(ans) != 0):
            del ans[-1]

for i in range(len(ans)):
    print(ans[i], end ="")

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

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

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

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

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

print(ans)

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

Solution (Python):
s = input()
text = ''

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

print(text)

Solution (Python):
l=list(input())
ans=[]
display=""

for i in range(len(l)):
  if l[i]=="B":
    if len(ans)>0:
      ans.pop()
  else:
    ans.append(l[i])

for i in range(len(ans)):
  display+=ans[i]

print(display)

Solution (Python):
ss=input()
anss=[]
for s in ss:
    if s == 'B':
        if anss: anss.pop()
    else:
        anss.append(s)
print(''.join(anss))

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

Solution (Python):
s=list(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)

Solution (Python):


s=input() 
a="" 
l=0 

for i in s:
    if i=="B": 
        a=a[0:l-1] 
        l-=1
    else: 
        a+=i
        l+=1
    if l<0: 
        l=0

print(a)

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

Solution (Python):
s=input()
ans=[]
for c in s:
  if c=='B' and len(ans)>0:
    ans.pop(-1)
  elif c=='B':
    pass
  else:
    ans+=c
print(''.join(ans))

Solution (Python):
S = input()

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

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


if __name__ == '__main__':
    main()

Solution (Python):
l=list(input())
ans=[]
display=""

for i in range(len(l)):
  if l[i]=="B":
    if len(ans)>0:
      ans.pop()
  else:
    ans.append(l[i])

for i in range(len(ans)):
  display+=ans[i]

print(display)

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

Solution (Python):
def listToString(_list, split=""):
    maped_list = map(str, _list)  
    mojiretu = split.join(maped_list)
    return mojiretu


s = input()
out = []
for i in range(len(s)):
    if s[i] == "0":
        out.append("0")
    elif s[i] == "1":
        out.append("1")
    else:
        if len(out) > 0:
            out.pop()
print(listToString(out))

Solution (Python):
s = input()

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

Solution (Python):
step = input()
s = list()
for c in step:
  if c == 'B':
    if len(s) > 0:
      s.pop()
  else:
    s.append(c)
for c in s:
  print(c, end = '')
print()

Solution (Python):
S=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()
ans=[]
for i in s:
    if len(ans) and i=='B': ans.pop()
    elif i!='B': ans.append(i)
print(''.join(ans))

Solution (Python):
sl = list(input())
res = ""
for s in sl:
    if s == "B" and res != "":
        res = res[:-1]
    if s in "01":
        res += s
print(res)

Solution (Python):
line = input()
str = list(line)
ans = []
c = 0

for i in str:
    if (i == "1") or (i == "0"):
        ans.append(i)
    elif i == "B":
        if c != 0:
            c -= 1
            del ans[c]
        c -= 1
    c += 1

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

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

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

Solution (Python):

s = input()

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)

Solution (Python):
s = input()
output = ""
cnt = 0
for i in s:
    if i == "0":
        output += "0"
        cnt += 1
    elif i == "1":
        output += "1"
        cnt += 1
    elif i == "B":
        if output != "":
            output = output[:-1]

print(output)

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

Solution (Python):
moji = list(input())
ans = []

for i in moji:
  if i == "0":
    ans.append("0")
  elif i == "1":
    ans.append("1")
  else:
    if len(ans) != 0:
      ans.pop()
    else:
      continue
    
print("".join(ans))

Solution (Python):
s = input()
string=[]
for i in s:
  if i == "B" and len(string)>0:
    del string[-1]
  elif i == "1" or i == "0":
    string.append(i)
print("".join(string))

Solution (Python):
s = input()

ans = []

for c in s:
	if c == '0':
		ans.append('0')
	elif c == '1':
		ans.append('1')
	else:
		if len(ans) != 0:
			ans.pop()
		
print("".join(ans))

Solution (Python):
s = input()

l = []
for i in s:
  if i == "B" and len(l) > 0:
    del l[-1]
  elif i == '0' or i == '1':
    l.append(i)

print("".join(l))

Solution (Python):
s=input()

s=list(s)

b=[]

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



c=str(b)
c=c.replace(",","")
c=c.replace("[","")
c=c.replace("]","")
c=c.replace(" ","")

print(c)

Solution (Python):
s = input()

out_str = ""
for i in range(len(s)) :
	if (s[i] == "B") :
		if (len(out_str) != 0) :
			out_str = out_str[:-1]
		continue
	
	out_str += s[i]

print(out_str)

Solution (Python):
S = input()
a = ''

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

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

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(1000000)



def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))



def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v



def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk



def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False



dp = None


def main():
    S = input()
    R = ""

    for s in S:
        if s == "B":
            if len(R) >= 1:
                R = R[:-1]
        else:
            R += s
    
    print(R)


main()

Solution (Python):
S=input()
L=""
n=0
while n<=len(S)-1:
  if S[n]=="1":
    L+="1"
  elif S[n]=="0":
    L+="0"
  elif S[n]=="B" and L!="":
    L=L[:-1]
  n+=1
print(L)

Solution (Python):
st = input()

ans = ""
for s in st:
    if s != "B":
        ans += s
    elif len(s):
        ans = ans[:len(ans) - 1]

print(ans)

Solution (Python):
S = input()

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

print(ans)

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

for i in range(len(a)):
  if a[i] == "0":
    b.append("0")
  elif a[i] == "1":
    b.append("1")
  elif a[i] == "B" and len(b) != 0:
    b.pop()
  else:
    continue
    
print("".join(b))

Solution (Python):
s = input()
ans = ''
for x in s:
    if x == 'B':
        if len(ans) == 0:
            continue
        else:
            ans = ans[:-1]
    else:
        ans += x

print(ans)

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

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

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

Solution (Python):


s = list(input())

ans = []
for i in s:
    if(i == '0' or i == '1'):
        ans.append(i)
    elif(i == 'B'):
        if(len(ans) == 0):
            continue
        else:
            ans.pop()
        
print(''.join(ans))

Solution (Python):

s = input()

ans = []
for a in s:
    if a == "B":
        if ans:
            ans.pop()
    else:
        ans.append(a)
print("".join(ans))

Solution (Python):

s = input()

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