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):
import sys
from collections import deque
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7



def main():
    S = input()
    L = len(S)
    d = deque()
    for i in range(L):
        if S[i]=='0':
            d.append(0)
        elif S[i]=='1':
            d.append(1)
        else:
            if len(d)!=0:
                d.pop()
    print(''.join(map(str,d)))



if __name__ == '__main__':
    main()

Solution (Python):
s = str(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):
            del(ans[-1])
print("".join(ans))

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

Solution (Python):
N = input()
ans = ''
for i in range(len(N)):
  if(ans == '' and N[i] == "B"):
    pass
  elif(ans == '' and N[i] != "B"):
    ans = N[i]
  elif(N[i] == "B"):
    ans = ans[:-1]
  else:
    ans += N[i]

print(ans)

Solution (Python):
def resolve():
    S = input()
    res = ""
    for s in S:
        if s in ['0', '1']:
            res += s
        else:
            if len(res) > 0:
                res = res[:-1]
    print(res)



if '__main__' == __name__:
    resolve()

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

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

print(ans)

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

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

Solution (Python):
moji = list(str(input()))
lst = []
for i in range(len(moji)):
  if moji[i]=="0":
    lst.append("0")
  elif moji[i]=="1":
    lst.append("1")
  elif moji[i]=="B" and len(lst)>0:
    del lst[-1]
  elif moji[i]=="B" and len(lst)==0:
    continue;
print(''.join(lst))

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

Solution (Python):
s, s_back = input(), ""
while "B" in s:
    s = s.replace("1B", "").replace("0B", "")
    if s_back == s:
        break
    s_back = s
print(s.replace("B", ""))

Solution (Python):
s=input()

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

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

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

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

Solution (Python):
s = input()

strings = ''

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

Solution (Python):

def main():
    s = input()
    ans = ""
    r = len(s)
    for i in range(r):
        if s[i] == "0":
            ans += "0"
        elif s[i] == "1":
            ans += "1"
        else:
            ans = ans[:-1]

    print(ans)
    
main()

Solution (Python):


s = input()

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

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

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

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

Solution (Python):
s = input()

out_s = []
for i in range(len(s)):
  if s[i] == '0' or s[i] == '1':
    out_s.append(s[i])
  elif s[i] == 'B':
    if len(out_s) != 0:
      del out_s[-1]

tmp = ''
for i in range(len(out_s)):
  tmp += out_s[i]
print(tmp)

Solution (Python):
if __name__ == '__main__':
    cmd = input()
    ans = []
    for char in cmd:
        if char == 'B':
            if len(ans) > 0 :
                ans.pop()
        else:
            ans.append(char)
    for c in ans:
        print(c,end="")

Solution (Python):
s = input()

t = ""
for i in s:
  if i == '0':
    t += '0'
  elif i == '1':
    t += '1'
  elif i == 'B' and t != "":
    t = t[:-1]
  else:
    continue
    
print(t)

Solution (Python):
s = input()

ans = []

for c in s:
    if c == "B":
        if ans:
            ans.pop()
    else:
        ans.append(c)

print("".join(ans))

Solution (Python):
s = input()

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

print(out)

Solution (Python):
string = ''

commands = list(input())

for c in commands:
  if (c == 'B'):
    string = string[:len(string)-1]
  if (c == '0' or c == '1'):
    string += c
    
print(string)

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

S = input()
ans = [''] * len(S)
cur = 0
for s in S:
    if s == 'B':
        cur -= 1
        ans[cur] = ''
        cur = max(0, cur)
    else:
        ans[cur] = s
        cur += 1

print("".join(ans))

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

    ans = []
    for i in range(len(s)):
        if s[i] != 'B':
            ans.append(s[i])
        elif s[i] == 'B' and ans:
            ans.pop(len(ans)-1)

    return ''.join(ans)

    
print(solve())

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

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

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

Solution (Python):
string = str(input())
stack = []
for i in range(len(string)):
	if string[i]!='B':
		stack.append(string[i])
	else:
		if  stack:
			stack.pop()
res = ''
for i in range(len(stack)):
	res+=stack[i]
print(res)

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

Solution (Python):
character_list = list(input())
new_character_list = []

for i in range(len(character_list)):
 if(character_list[ i ] == '0' ):
  new_character_list.append(character_list[ i ])
 elif(character_list[ i ] == '1'):
  new_character_list.append(character_list[ i ])
 else:
  if(len(new_character_list) != 0):
   new_character_list.pop()

print(''.join(new_character_list))

Solution (Python):
def myAnswer(s:list)->str:
   ans = []
   for string in s:
      if(string == "B"):
         if(ans == []):
            continue
         else:
            ans.pop()
      else:
         ans.append(string)

   return "".join(ans)

def modelAnswer():
   return
def main():
   s = list(input())
   print(myAnswer(s))
if __name__ == '__main__':
   main()

Solution (Python):
ss=list(input())
r=''
for i, s in enumerate(ss):
  if s != 'B':
    r+=s
  elif len(r)>0:
    r=r[:-1]
print(r)

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

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

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

Solution (Python):
s = input()
ans = ""
while len(s) > 1:
    t = s[0]
    s = s[1:]
    if t == "B":
        ans = ans[:-1]
    else:
        ans += t
t = s[0]
if t == "B":
    ans = ans[:-1]
else:
    ans += t
print(ans)

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

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

print(ans)

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

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

for i in s:
    if i=="0":
        ans+="0"
    elif i=="1":
        ans+="1"
    elif i=="B":
        ans=ans[:-1]
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 :
			a.pop()
print(''.join(map(str,a)))

Solution (Python):
a=input()
ans=""
while len(a)>0:
  if a[0]=="0":
    ans+="0"
  elif a[0]=="1":
    ans+="1"
  elif len(ans)>0:
    ans=ans[:-1]
  a=a[1:]
print(ans)

Solution (Python):
















S = input()

ans = []
for s in list(S):
    if s != "B":
        ans.append(s)
    elif len(ans)==0:
        pass
    else:
        ans.pop()

print(*ans,sep="")

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    s = input().rstrip()
    ans = ""
    for i in range(len(s)):
        if s[i] in ["0", "1"]:
            ans += s[i]
        else:
            ans = ans[:-1]

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
s=input()
a=[]
for i in range(len(s)):
    if s[i]=="0":
        a.append(str(0))
    elif s[i]=="1":
        a.append(str(1))
    elif s[i]=="B":
        if len(a)>0:
            a.pop(-1)
print("".join(a))

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

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

print(*ans, sep='')

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

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

print(ans)

Solution (Python):
s = input()

A = []
for c in s:
    if c == "0":
        A.append("0")
    elif c == "1":
        A.append("1")
    elif A:
        A.pop()

print("".join(A))

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

print("".join(a))

Solution (Python):
S = input()
d = []
for s in S:
    if s == '0' or s == '1':
        d.append(s)
    else:
        d = d[:-1]

print(*d, sep='')

Solution (Python):
from collections import deque

command = list(input())
d = deque([])

for i in command:
	if i == "B" and d:
		d.pop()
	elif i == "0" or i == "1":
		d.append(i)

for s in d:
	print(s, end="")
print()

Solution (Python):
s = input()
li = list(s)
tmp = []
for l in li:
    if l == '0':
        tmp.append(l)
    elif l == '1':
        tmp.append(l)
    else:
        if len(tmp)>0:
            tmp.pop(-1)
print(''.join(tmp))

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

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

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

print("".join(ans))

Solution (Python):


def main():
    s = input()
    res = []
    for c in s:
        if c == "B":
            if len(res) > 0:
                res.pop()
        else:
            res.append(c)
    print("".join(res))

if __name__ == "__main__":
    main()

Solution (Python):
S = list(input())
edita = []
for a in S:
    if a == "B":
        if not edita:
            continue
        else:
            edita.pop()
    else:
        edita.append(a)

for a in edita:
    print(a, end="")

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

for s in list_S:
    if s == "B" and len(ans) != 0:
        ans.pop(-1)
    else:
        if s != "B":
            ans.append(s)

print("".join(ans))

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


for i in range(0,len(s)):
  if(s[i]=="0"):
    a.append(0)
  elif(s[i]=="1"):
    a.append(1)
  elif(s[i]=="B" and len(a)==0):
    continue
  elif(s[i]=="B"):
    del a[-1]

L=[str(a) for a in a]
L="".join(L)
print(L)

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

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

for i in s:
        if  i == "B":
            try:
                answer.pop()
            except:
                pass
        else:
            answer.append(i)

print("".join(answer))

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

for i in s:
        if  i == "B":
            try:
                answer.pop()
            except IndexError:
                pass
        else:
            answer.append(i)

print("".join(answer))

Solution (Python):
s = list(input())
ans = []
for i in s:
  if i == 'B':
    try:
      ans.pop()
    except IndexError:
      pass
  else:
    ans.append(i)

print(''.join(ans))

Solution (Python):
s=input()

a=""
for i in range(len(s)):
    if s[i]=="0":
        a+="0"
    elif s[i]=="1":
        a+="1"
    elif len(a)!=0 and s[i]=="B":
        a=a[0:-1]
    else:
        continue
print(a)

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

print(ans)

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

    s = input().rstrip()
    res = []
    for i in s:
        if i=='0' or i=='1':
            res.append(i)
        else:
            res = res[:-1]
    print(*res, sep='')

if __name__ == '__main__':
    main()

Solution (Python):
S=str(input())
str_ = ""
for i in range(len(S)):
  if S[i] == "0" or S[i] == "1":
    str_ = str_ + S[i]
  elif len(str_) != 0:
    str_ = str_[:-1]
print(str_)

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

Solution (Python):
S = str(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):
N=input()
c=""
for i  in N:
    if i=="0":
        c+="0"
    elif i=="1":
        c+="1"
    elif i=="B" and len(c)!=0:
        c=c[0:-1]  
print(c)

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

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

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

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

ans = []

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

print(''.join(ans))

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

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

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

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

Solution (Python):
s = input()
from collections import deque
dq = deque()
for i in range(len(s)):
    if s[i] == "B":
        if len(dq) == 0:
            continue
        dq.pop()
        continue
    dq.append(s[i])
print("".join(dq))

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

Solution (Python):





s = input()
ans = []

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

print("".join([str(n) for n in ans]))

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

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

Solution (Python):
s = input()

ans = []

for i in s:
    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()
x=""
for i in range(len(s)):
  if len(x)==0 and s[i]=="B":
    continue
  else:
    if s[i]=="B":
      x=x[:-1]
    else:
      x+=s[i]
print(x)

Solution (Python):
import sys
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

from collections import deque

s = ns()

st = deque()
for i in range(len(s)):
    if s[i] == 'B':
        if len(st) >= 1:
            st.pop()
    else:
        st.append(s[i])

print(*list(st), sep="")

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

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

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

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

Solution (Python):
def scanning(s):
    def resolve(s, ans):
        if s == '':
            return ans
        elif s[0] == 'B' and len(ans) >= 0 :
            ans = ans[0:-1]
        else:
            ans += s[0]
        return resolve(s[1::], ans)
    return resolve(s, '')

print(scanning(input()))

Solution (Python):
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
MIIZ = lambda: list(map(lambda x: x-1, MII()))
from collections import deque

def main():
    s = IS()
    dq = deque()
    for c in s:
        if c == 'B':
            if dq: dq.pop()
            else: continue
        else: dq.append(c)
    print(''.join(dq))


if __name__ == '__main__':
    main()

Solution (Python):
from collections import deque
s=input()
l=deque()
for i in range(len(s)):
  if s[i]=="B":
    if len(l)>0:
      l.pop()
  else:
    l.append(s[i])
l="".join(l)
print(l)

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

Solution (Python):
s = input()
ans = []
for i in s:
    if i == "1":
        ans += [1]
    elif i == "0":
        ans += [0]
    elif len(ans) > 0:
        ans.pop(-1)
for x in ans:
    print(x, end="")

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 bool(a):
            a.pop(-1)

result = ''.join(a)

print(result)

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

Solution (Python):
s = input()
ans = ""
for i in s:
    if(i == 'B'):
        ans = ans[:-1]
    else:
        ans += i
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'
  else:
    if (len(ans) != 0):
      ans = ans[:-1]

print(ans)

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

for i in s:
    if i=="0":
        ans.append(0)
    elif i=="1":
        ans.append(1)
    else:
        if ans==[]:
            pass
        else:
            ans.pop()

print(*ans,sep="")

Solution (Python):
s = input()

result = ''
for c in s:
    if c == '0' or c == '1':
        result += c
    elif c == 'B':
        result = result[:-1]
print(result)

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

ans = ''

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

print(ans)

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

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

Solution (Python):
S = input()

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

print(ans)

Solution (Python):
arg=input()
ans=[]
for char in arg:
  if char=='1' or char=='0':
    ans.append(char)
  elif char=='B':
    if ans!=[]:
      del ans[-1]
print(''.join(ans))

Solution (Python):
s = input()
L = len(s)

ans = ""

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

print(ans)

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

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

Solution (Python):
def function(s):
  ans = ""
  for i in s:
    if i != "B":
      ans += i
    else:
      ans = ans[:len(ans) - 1]
  return ans

s = input()
print(function(s))

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

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

for c in s:
    if c == '0' or c == '1':
        ans.append(c)
    elif c == 'B' and len(ans) != 0:
        ans.pop()

print(''.join(ans))

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

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

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

print(''.join(ans))

Solution (Python):
s = str(input())
ans = str()
for ch in s:
    if ch == '0':
        ans += '0'
    elif ch == '1':
        ans += '1'
    elif ch == 'B':
        if len(ans) != 0:
            ans = ans[:len(ans)-1]

print(ans)

Solution (Python):
s = input()

editor = ''

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

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):
s=input()
ans='w'*60
for i in range(0,len(s)):
    if s[i]=='0':
        ans+='0'
    elif s[i]=='1':
        ans+='1'
    elif s[i]=='B':
        ans=ans[:-1]
    else:
        pass
A=s.count('0')
B=s.count('1')
C=s.count('B')

for j in range(0,60+A+B-C):
    ans=ans.lstrip('w')

print(ans)

Solution (Python):
def main():
    s = input()
    display = list()

    for i in range(len(s)):
        if s[i] == "B" :
            if len(display) > 0:
                display.pop()
        else:
            display.append(s[i])
    print("".join(map(str,display)))
main()

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

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

Solution (Python):
from collections import deque

s = input()
q = deque()
for c in s:
    if c == '0':
        q.append('0')
    elif c == '1':
        q.append('1')
    elif c == 'B':
        if len(q) == 0:
            continue
        q.pop()

print(''.join(q))

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

hoge = []
for si in s:
  if si != "B":
    hoge.append(si)
  elif si == "B" and len(hoge) > 0:
    hoge.pop()
    
print("".join(hoge))

Solution (Python):

import collections


def solve(string):
    stack = []

    for ch in string:
        if ch == "B":
            if stack:
                stack.pop()
        else:
            stack.append(ch)

    return "".join(stack)


string = input().strip()
print(solve(string))

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

Solution (Python):
s=input()

s=list(s)

ans = []

for i in s:
    if i == '0':
        ans.append(i)
    elif i == '1':
        ans.append(i)
    else:
        if len(ans) > 0:
            ans.pop(-1)
print(''.join(map(str,ans)))

Solution (Python):
s = []
for i in input():
  if i == "B":
    try:
      del s[-1]
    except IndexError:
      pass
  else:
    s += i
print(*s, sep="")

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

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

Solution (Python):
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = list(iss())
    ret = []
    for s in S:
        if s == "0":
            ret.append("0")
        elif s == "1":
            ret.append("1")
        elif s == "B" and len(ret) > 0:
            ret.pop()

    print("".join(ret))


if __name__ == '__main__':
    main()

Solution (Python):
s = []
command = list(input())

for i in range(len(command)):
  if command[i]=='0':
    s.append('0')
  elif command[i]=='1':
    s.append('1')
  else:
    if len(s):
    	s.pop()
        
print(''.join(s))

Solution (Python):
s = input()

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

print(ans)