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 = list(input())

ans = []
for i in s:
    if i != 'B':
        ans.append(i)
    else:
        if ans == []:
            pass
        else:
            ans.pop()

print (*ans, sep = '')

Solution (Python):

if __name__ == "__main__":
    word = input()
    res = []
    for letter in word:
        if letter == 'B':
            if len(res) != 0:
                res.pop()
        else:
            res.append(letter)
    print("".join(res))

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

Solution (Python):
n = input()
l = ''
for i in n:
  c = 0
  if i == '1' or i == '0':
    l += i
  else:
    l = l[:len(l)-1]
print(l)

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)

    elif s[i] == "B":
        if ans != []:
            ans.pop()
print(*ans, sep="")

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

Solution (Python):
import re

s = input()

while 'B' in s:
    s = re.sub(r'[01]B', '', s)
    s = re.sub(r'^B+', '', s)
print(s)

Solution (Python):
import re

s = input()

while 'B' in s:
    s = re.sub(r'^B+', '', s)
    s = re.sub(r'[01]B', '', s)
print(s)

Solution (Python):
import re

s = input()

while re.search(r'B', s):
    s = re.sub(r'^B+', '', s)
    s = re.sub(r'[01]B', '', s)
print(s)

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

for i in s:
    if i != 'B':
        b.append(i)
    elif b:
        b.pop()
    
print(''.join(b))

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

for i in s:
    if i == 'B':
        if len(b) != 0:
            b.pop()
    else:
        b.append(i)
    
print(''.join(b))

Solution (Python):



s = input()
ret = []
for key in s:
    if key == 'B':
        if ret: ret.pop()
    else:
        ret.append(key)
        
print(''.join(ret))

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

Solution (Python):
import re
s=input()
while 'B' in s:
    s=s.lstrip('B')
    s=re.sub(r'[0,1]B','',s)
print(s)

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

Solution (Python):
s = input()

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

print(*ans, sep='')

Solution (Python):
s=input()
a=[]
for i in range(len(s)):
    if s[i]=='B':
        if len(a)>0:
            a.pop(-1)
    else:
        a.append(s[i])
print(*a,sep='')

Solution (Python):
S = input()
ans = list()
for s in S:
	if s != 'B':
		ans.append(s)
	elif len(ans) != 0:
		ans.pop()
print(''.join(ans))

Solution (Python):
s = input()
w = ""
for k in s:
    if k == "B" and len(w) > 0:
        w = w[:-1]
    if k in ["0", "1"]:
        w += k
print(w)

Solution (Python):
import re
s = input()
for i in range(4):
  s = re.sub("[0-1]B","",s)
print(s.replace("B",""))

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

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

Solution (Python):
S = input().strip()
ans = ''
for c in S:
  if c == 'B':
    if len(ans) > 0:
      ans = ans[:-1]
  else:
    ans += c
print(ans)

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

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    s = str(input().rstrip('\n'))
    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))


if __name__ == '__main__':
    slove()

Solution (Python):
s = input()
r = []
for i in s:
  if i == "B":
    if r:
      del r[-1]
  else:
    r.append(i)
print(*r, sep="")

Solution (Python):
s = input()
l = list(s)
r = []
for i in l:
  if i == "0":
    r.append("0")
  elif i =="1":
    r.append("1")
  else:
    if r == []:
      continue
    else:
      del r[-1]
print(*r, sep="")

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

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

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

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

print(''.join(ans))

Solution (Python):
S = input()
stack = []
for s in S:
    if s != "B":
        stack.append(s)
    elif not stack:pass
    else:stack.pop()
print(*stack,sep="")

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

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

Solution (Python):
input_list = input()
out_list=list()
for i in range(len(input_list)):
    if input_list[i] == "0":
        out_list.append('0')
        i +=1
    elif input_list[i] == "1":
        out_list.append('1')
        i +=1
    else:
        if not len(out_list)==0:
            out_list.pop()
for j in out_list:
    print(j,end="")

Solution (Python):

orders = list(input())
out_list = []
for od in orders:
  if od == "0":
    out_list.append("0")
  elif od == "1":
    out_list.append("1")
  elif od == "B":
    if len(out_list) != 0:
      out_list.pop(-1)
out_str = "".join(out_list)
print(out_str)

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

for str_i in s:
  if str_i == '0':
    ans += '0'
  elif str_i == '1':
    ans += '1'
  elif str_i == 'B':
    ans = ans[:len(ans)-1]
    
print(ans)

Solution (Python):
s = input()

result = ""
for ch in s:
  if ch == "B":
    result = result[:-1]
  else:
    result += ch

print(result)

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

Solution (Python):
s = input()
res=[]
for i in s:
    if i=='0':
        res.append('0')
    if i=='1':
        res.append('1')
    if i=="B":
        if len(res)==0:
            pass
        else:
            res.pop()
print(''.join(res))

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

ans=[]

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

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

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

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

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

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 c in s:
    if c == "0":
        ans += "0"
    elif c == "1":
        ans += "1"
    elif c == "B":
        ans = ans[:-1]
print(ans)

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

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

for ch in S:
    if ch == 'B':
        if result: result.pop()
        continue
    result.append(ch)

print(''.join(result))

Solution (Python):
t = ""

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

print(t)

Solution (Python):
def resolve():
	s=input()
	while '1B' in s:
		s=s.replace('1B','')
	while '0B' in s:
		s=s.replace('0B','')
	s=s.replace('B','')
	print(s)
resolve()

Solution (Python):
s = list(input())
a = []
for i in range(len(s)):
    if s[i] == "B" and a != []:
        del a[-1]
    elif s[i] == "B" and a == []:
        continue
    else:
        a.append(str(s[i]))
print("".join(a))

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

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

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

Solution (Python):
key = list(input())
k = []

for n in key:
  if n == "0" or n == "1":
    k.append(n)
  elif len(k) != 0:
    k.pop()
  else:
    pass
  
print("".join(k))

Solution (Python):


s = input()

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

ans = "".join(ans)
print(ans)

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

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

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

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

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

Solution (Python):
s = list(input())
len_s = len(s)
output = []
for i in range(0,len_s):
    if s[i] == "B":
        try:
            output.pop(-1)
        except:
            pass
    else:
        output.append(s[i])
print("".join(output))

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

Solution (Python):
s=list(input())
ans=[]
while s:
    x=s.pop(0)
    if x=='0': ans.append('0')
    elif x=='1': ans.append('1')
    elif x=='B' and len(ans): ans.pop()
print(''.join(ans))

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

Solution (Python):
import collections

S=input()
N=len(S)
D=collections.deque([])

for i in range(N):
  if S[i]=="B":
    if len(D):
      D.pop()
  else:
    D.append(S[i])
print("".join(list(D)))

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


if __name__ == "__main__":
    resolve()

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

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

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

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

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')


S=input()
ans=""

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

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')


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 s:
    if i == '0' or i == '1':
        ans.append(i)
    else:
        if len(ans) != 0:
            ans.pop()
print("".join(ans))

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

Solution (Python):
import re
t = input()
while "B" in t:
    t = t.lstrip("B")
    t = re.sub('[0,1]B','', t)
print(t)

Solution (Python):
s=input()

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

Solution (Python):
a=""
for x in input():a=(a+x,a[:-1])[x>"A"]
print(a)

Solution (Python):
i=input();a=""
for x in i:a=(a+x,a[:-1])[x>"A"]
print(a)

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

Solution (Python):
S = input()
ans = ""
for s in S:
    if s in {'0', '1'}:
        ans += s
    else:
        ans = ans[:-1]
print(ans)

Solution (Python):
s = []

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

print("".join(s))

Solution (Python):
from collections import deque

s = input()

ans = deque()

for i in s:
    if i == 'B':
        if ans != deque([]):
            ans.pop()
    else:
        ans.append(i)

ans = "".join(list(ans))

print(ans)

Solution (Python):
s = list(input())
for i in range(len(s)):
    if i == 0 and s[i] == "B":
        s[i] = ""
    elif s[i] == "B":
        s[i] = ""
        flg = 0
        back = 1
        while True:
            if s[i-back] == "":
                back += 1
            elif s[i-back] != "":
                s[i-back] = ""
                break
            if i-back<0: break

print("".join(s))

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

Solution (Python):
data = input()
x = ""

for i in range(len(data)):
    if data[i] == "B":
        if x != "":
            x = x[0:-1]
    else:
        x += data[i]

print(x)

Solution (Python):
s = input()
a = ""
for i in range(0, len(s)):
  if s[i] == "0":
    a += "0"
  elif s[i] == "1":
    a += "1"
  elif s[i] == "B" and len(a) != 0:
    b = a[0:-1]
    a = b
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()
a = []
for s in S:
    if s=='0' or s=='1':
        a.append(s)
    else:
        try:
            a.pop()
        except:
            pass
print(''.join(a))

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

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

S = []
for i in range(len(s)):
    if s[i] == "0":
        S += s[i]
    elif s[i] == "1":
        S += s[i]
    elif len(S) == 0:
        pass
    else:
        del S[-1]
print("".join(S))

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

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

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

print(''.join(ans))

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

res = ''

slist = []

for i in range(len(s)):
    if s[i] == 'B':
        if slist != []:
            slist = slist[:-1]
    else:
        slist.append(s[i])

for i in range(len(slist)):
    res += slist[i]

print(res)

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

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:
        ans=ans[0:len(ans)-1]
print(ans)

Solution (Python):



s = input()



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

Solution (Python):
a = []

for s in input():
    if s == 'B':
        if a == []:
            continue
        else:
            del a[-1]
    else:
        a.append(s)

print(''.join(a))

Solution (Python):
s = input()

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

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

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

for n in range(len(s)):
    if s[n] == '1' or s[n] == '0':
        output.append(s[n])
    elif s[n] == 'B' and output != []:
        backspace = len(output)-1
        output = output[:backspace]
print(''.join(output))

Solution (Python):
str=input()
x=list(str)
a=[]
for i in range(len(x)):
  if x[i]=='0' or x[i]=='1':
    a.append(x[i])
  else:
    if not a==[]:
      a.pop()
print(''.join(a))

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[:len(ans)-1]
print(ans)

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

for cha in s:
    if cha == 'B':
        if len(ans_s) == 0:
            continue
        else:
            ans_s = ans_s[:-1]
    else:
        ans_s += cha

print(ans_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:
    try:ans.pop()
    except:pass
print("".join(ans))

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

Solution (Python):

import sys


def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

s = IS()
a = ""
for txt in s:
    if txt != "B":
        a += txt
    else:
        if len(a) != 0:
            a = a[:-1]
print(a)

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

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

Solution (Python):
a = []
for s in input():
    if "B" in s:
        if not a:continue
        else:a.pop()
    else:a.append(s)
print(*a,sep="")

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

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

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

Solution (Python):
def keyboard(s):
    result = ""
    for i in range(0,len(s)):
        if s[i] == "0":
            result += "0"
        elif s[i] == "1":
            result += "1"
        elif s[i] == "B":
            result = result[:-1]
    print(result)

keyboard(input())

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):
orders = input()
display = ''
for order in orders:
  if order == 'B':
    if display == '':
      pass
    elif display != '':
      display = display[:-1]
  elif order == '1':
    display = display + '1'
  elif order == '0':
    display = display + '0'

print(display)

Solution (Python):
import sys

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = 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[:-1]
print(ans)

Solution (Python):
s = input()
for _ in range(10):
	s=s.replace("1B", "").replace("0B","")
s=s.replace("B","")
print(s)

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

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()
    
print(*ans,sep ="")

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

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

print(''.join(ans))

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

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

Solution (Python):
def main():                                                                     
  data = raw_input()                                                            
  row = []                                                                      
  for c in data:                                                                
    if c == "B":                                                                
      if len(row):                                                              
        row.pop()                                                               
      continue                                                                  
    row.append(c)                                                               
  print(''.join(row))                                                           
                                                                                
main()

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

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

Solution (Python):
s = input()

output = ""

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

print(output)

Solution (Python):
stack=[]
for i in input():
    if i=="B" and stack:
        stack.pop()
    elif i!="B":
        stack.append(i)
print("".join(stack))

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

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

print(e)

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

Solution (Python):
s=input()
stack=[]
for i in s:
    if i=="B" and stack:
        stack.pop()
    elif i!="B":
        stack.append(i)
print("".join(stack))

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

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

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

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

stack = []

for i in S:

    
    if i=="B":
        if len(stack)==0:
            continue
        else:
            stack.pop()
    else:
        
        stack.append(i)
str = ""
for i in range(len(stack)):
    str = str+stack[i]
print(str)

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

Solution (Python):
s = list(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[0:len(ans) - 1]

print(ans)

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

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

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

Solution (Python):
def main():

    s = input()
    stack = []
    for c in s:
        if c in "01":
            stack.append(c)
        else:
            if stack:
                stack.pop()
    return "".join(stack)

if __name__ == '__main__':
    print(main())

Solution (Python):
s = []
for c in input():
    if c == 'B':
        s and s.pop()
    else:
        s.append(c)

print(''.join(s))

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

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

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

Solution (Python):
s = input()
stack = ""
for x in s:
    if x in ["0", "1"]:
        stack += x
    else:
        if len(stack) != 0:
            stack = stack[:-1]
print(stack)

Solution (Python):
s = input()

result = []
for b in s:
    if b == '0':
        result.append('0')
    elif b == '1':
        result.append('1')
    else:
        result = result[:-1]
print(''.join(result))

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

print("".join(ans))

Solution (Python):
S=input()

ans=''
for s in S:
  if s=='0':
    ans=ans+'0'
  elif s=='1':
    ans=ans+'1'
  else:
    ans=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")
  else:
    if b!=[]:
      b.pop()
print(*b,sep="")

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

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

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

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

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"and t!="":
        t=t[:-1]

print(t)