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.



Sample input:
01B0


Sample output:
00

Submission status: Wrong Answer

Solution code:
s = str(input())

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

print(ans)

Submission status: Wrong Answer

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

    print(''.join(ans))

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

Submission status: Wrong Answer

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

    print(''.join(ans))

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

Submission status: Wrong Answer

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

    print(ans)

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

Submission status: Wrong Answer

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

    print(ans)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
answer=""
for c in s:
  if c != "B":
    answer+=c
  elif answer != "":
    answer = answer[0:len(answer)]
  else:
    continue
print(answer)

Submission status: Wrong Answer

Solution code:
s=input()
temp = ""
for c in s:
  if c == '1' or c == '0':
    temp += c
  else:
    temp = temp[0:len(temp)]
print(temp)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=list(input())

for i in range(1,len(s)):
  if s[i]=='B':
    s[i]=''
    if s[i-1]=='':
      s[i-2]=''
    else:
      s[i-1]=''

output=""
for j in range(len(s)):
  output=output+s[j]
  
print(output)

Submission status: Wrong Answer

Solution code:
s=list(input())

for i in range(1,len(s)):
  if s[i]=='B':
    s[i-1]=''
    s[i]=''

output=""
for j in range(len(s)):
  output=output+s[j]
  
print(output)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
a = ''

for i in range(len(s)):
    if s[i] in '01':
        if i+ 1 == len(s) or s[i+1] != 'B':
            a += s[i]
print(a)

Submission status: Wrong Answer

Solution code:
S = input()
str = []
result = ""
flg = 0
for i in range(len(S)):
    if S[i] == 'B':
        result = result[:-1]
    else:
        result += S[i]
print(result)
print(result[:-1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = ''
for x in s:
    if x == '1' or x == '0':
        ans += x
    elif x == 'B':
        ans += 'b'
print(ans.replace('1b', '').replace('0b', '').replace('b', ''))

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = ''
for x in s:
    if x == '1' or x == '0':
        ans += x
    else:
        ans += 'b'
print(ans.replace('1b', '').replace('0b', '').replace('b', ''))

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = ''
for x in s:
    if x == '1' or x == '0':
        ans += x
    elif ans:
        ans += 'b'
print(ans.replace('1b', '').replace('0b', '').replace('b', ''))

Submission status: Wrong Answer

Solution code:
S = input()
ans = ""
k = []
for i in range(len(S)):
  if S[i] == "0":
    k.append("0")
  elif S[i] == "1":
    k.append("1")
  else: 
    #つまり"B"のとき
    if len(k) != 0:
      k.remove(k[-1])
for i in range(len(k)):
  ans += k[i]
print(ans)

Submission status: Wrong Answer

Solution code:
m = input()
l = []

for char in m:
    l.append(char)

k = []

for i in range(len(l)):
    if i > 0:
        if l[i] == "B":
            k = k[:(i-1)]
        else: k.append(l[i])
    else: 
        if l[i] == "B":
            
            pass
        else: k.append(l[i])

result = ""
for j in k:
    result += j

print(result)

Submission status: Wrong Answer

Solution code:
s = input()
ans = []
for c in s:
    if (c == 'B'):
        if (len(ans) > 0):
            ans.pop(-1)
    else:
        ans.append(c)

print(str(ans))

Submission status: Wrong Answer

Solution code:
S = str(input())

lis = list(S)
t = ''

for u in lis:

    if u == '0' or u == '1':
        t =  t + u
    elif u == 'B' and len(t) > 0:
        t = t[0-len(t)]
 
print(t)

Submission status: Wrong Answer

Solution code:
s = input()
o = ""

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

Submission status: Wrong Answer

Solution code:
s = input()
o = []

for i in range(len(s)):
	if s[i] == "0":
		o.insert(0,"0")
	elif s[i] == "1":
		o.append("1")
	else:
		if len(o) > 0:
			o.pop()
print ("".join(o))

Submission status: Wrong Answer

Solution code:
s = list(str(input()))
ans = []
for i in s:
  if i == "B":
    if ans == []:
      continue
    else:
      ans.remove(ans[-1])
  else:
    ans.append(i)
print("".join(ans))

Submission status: Wrong Answer

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

for _ in range(len(s)):
  if "B" in s:
    del s[s.index("B")-1]
    del s[s.index("B")]
  else:
    pass

print(*s)

Submission status: Wrong Answer

Solution code:
s = str(input())

s = s.split('B')

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

Submission status: Wrong Answer

Solution code:
s = str(input())

print(s.replace('B',''))

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = []
for e in s:
    if e == "B" and len(ans) > 0:
        ans.pop(-1)
    else:
        ans.append(e)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=str(input())
x=''
list=[]
for i in range(len(s)):
    if s[i]=='1':
        list.append('1')
    elif s[i]=='0':
        list.append('0')
    elif s[i]=='B' and len(list)!=0:
        list.remove(list[len(list)-1])

for i in range(len(list)):
    x += list[i]

print(x)

Submission status: Wrong Answer

Solution code:
N = list(input().strip())
a=len(N)
count = []
counter = 0
for n,i in zip(N,range(a)):
  if n != 'B':
    count.append(int(n))
  else:
    if len(count) == 0:
      break
    else:
      del(count[len(count)-1]) 
p = ''.join(map(str,count))
print(p)

Submission status: Wrong Answer

Solution code:
s = list(input())
for i in range(len(s)):
    if s[i] == "B":
        s[i-1] = ""
        s[i] = ""
print("".join(s))

Submission status: Wrong Answer

Solution code:
arr =list(input())
ret=""
for st in arr:
  if(st == "B"):
    ret = ret[:len(st)-1]
  else:
    ret = ret + st
      
print(ret)

Submission status: Wrong Answer

Solution code:
S = input()
ansS = ""
ansL = 0
for i in range(len(S)-2):
  if S[i+1] == 'B':
    if len(ansS) != 0 :
      ansL = len(ansS)
      ansS = ansS[:ansL-1]
  else:
    ansS += S[i+1]

print(ansS)

Submission status: Wrong Answer

Solution code:
S = input()
ansS = ""
ansL = 0
for i in range(len(S)):
  if S[i] == 'B':
    if len(ansS) != 0 :
      ansL = len(ansS)
      ansS = ansS[:ansL-1]
  else:
    ansS += S[i]

print(int(ansS))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=list(input())
i=1
ll=[]
s.reverse()
while i<=len(s):
  if s[i-1]=="B":
    i+=2
  else:
    ll.append(s[i-1])
    i+=1
ll.reverse()  
for i in ll:
  print(i,end="")

Submission status: Wrong Answer

Solution code:
S = input()
str = ""

for i in range(0, len(S)):
    if S[i] == '0':
        str+= "0"
    elif S[i] =='1':
        str+="1"
    elif S[i]=='B':
        str+="B"
else:
    print(str)

Submission status: Wrong Answer

Solution code:
S = input()
str=""

for i in range(0, len(S)):
    if  S[i] == '0':
        str+= "0"
    elif S[i] =='1':
        str+="1"
    elif S[i]=='B':
        str+="B"
else:
    print(str)

Submission status: Wrong Answer

Solution code:
#2019/10/22
s = open(0).read()
display = []
for i in s:
    if i == "0":
        display.append("0")
    elif i == "1":
        display.append("1")
    else:
        if display == []:
            continue
        else:
            display.pop(-1)

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

Submission status: Wrong Answer

Solution code:
s = input()
newS = ""
for i in range(len(s)):
    if s[i] == "B":
        if s[0] == "B":
            s = s.replace(s[0],'x')
        else:
            s = s.replace(s[i-1]+s[i],'xx')

ans = s.replace('x','')
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
newS = ""
for i in range(len(s)):
    if s[i] == "B":
        if s[0] == "B":
            s = s.replace(s[0],'x')
        else:
            s = s.replace(s[i-1]+s[i],'xx')
            print(s)
ans = s.replace('x','')
print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = ""
add = ""

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]

if len(ans) == 0:
    for i in range(len(s)):
        if s[i] != "B":
            add = s[i]
    ans = add

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = ""
add = ""

for i in range(len(s)):
    if s[i] == "0":
        ans += "0"
    elif s[i] == "1":
        ans += "1"
    elif s[i] == "B":
        if len(ans) != 0:
            ans = ans.replace(ans[len(ans) - 1], "", 1)
        else:
            pass

if len(ans) == 0:
    for i in range(len(s)):
        if s[i] != "B":
            add = s[i]
    ans = add

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = ""
add = 0

for i in range(len(s)):
    if s[i] == "0":
        ans += "0"
    elif s[i] == "1":
        ans += "1"
    elif s[i] == "B":
        if len(ans) != 0:
            ans = ans.replace(ans[len(ans) - 1], "", 1)
        else:
            pass

if len(ans) == 0:
    for i in range(len(s)):
        if s[i] != "B":
            add = s[i]
    ans = add

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = ""
letters = 1

for i in range(len(s)):
    if s[i] == "0":
        ans += "0"
    elif s[i] == "1":
        ans += "1"
    elif s[i] == "B":
        if len(ans) != 0:
            ans = ans.replace(ans[len(ans) - 1], "", 1)
        else:
            pass

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = ""
letters = 1

for i in range(len(s)):
    if s[i] == "0":
        ans += "0"
    elif s[i] == "1":
        ans += "1"
    elif s[i] == "B":
        if len(ans) != 0:
            ans = ans.replace(ans[len(ans) - 1], " ", 1)
        else:
            pass

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = ""
letters = 1

for i in range(len(s)):
    if s[i] == "0":
        ans += "0"
    elif s[i] == "1":
        ans += "1"
    elif s[i] == "B":
        if len(ans) > 1:
            ans = ans.replace(ans[len(ans) - 1], "", 1)
        else:
            pass

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = ""
letters = 1

for i in range(len(s)):
    if s[i] == "0":
        ans += "0"
    elif s[i] == "1":
        ans += "1"
    elif s[i] == "B":
        if len(ans) > 0:
            ans = ans.replace(ans[len(ans) - 1], "", 1)
        else:
            pass

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = ""

for i in range(len(s)):
    if s[i] == "0":
        ans += "0"
    elif s[i] == "1":
        ans += "1"
    elif s[i] == "B":
        if len(ans) > 1:
            ans = ans.replace(s[i-1], "", 1)
        else:
            pass

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = ""

for i in range(len(s)):
    if s[i] == "0":
        ans += "0"
    elif s[i] == "1":
        ans += "1"
    elif s[i] == "B":
        if len(ans) > 0:
            ans = ans.replace(s[i-1], "", 1)
        else:
            pass

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = ""

for i in range(len(s)):
    if s[i] == "0":
        ans += "0"
    elif s[i] == "1":
        ans += "1"
    elif s[i] == "B":
        if len(ans) > 1:
            ans = ans.replace(s[i-1], "")
        else:
            pass

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = ""

for i in range(len(s)):
    if s[i] == "0":
        ans += "0"
    elif s[i] == "1":
        ans += "1"
    elif s[i] == "B":
        if len(ans) > 0:
            ans = ans.replace(s[i-1], "")
        else:
            pass

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

n = len(s)
tmp = 0
while tmp < n  - 1:
    if s[tmp + 1] != 'B' and s[tmp] != 'B':
        print (s[tmp], end = '')
        tmp += 1
    else:
        tmp += 1

if s[-1] != 'B':
    print (s[-1])
else:
    print ()

Submission status: Wrong Answer

Solution code:
s = list(input())

n = len(s)
tmp = 0
while tmp < n  - 1:
    if s[tmp + 1] != 'B' and s[tmp] != 'B':
        print (s[tmp], end = '')
        tmp += 1
    else:
        tmp += 1

print (s[-1])

Submission status: Wrong Answer

Solution code:
import re

s = input()

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import re
s=input()
while s[0]=='B':
    s=s[1:]
    if len(s)==0:
      print()
      exit()
s=re.sub(r'.B+','',s)
print(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import re
s=input()
if s[0]=='B':
    s=s[1:]
s=re.sub(r'.B+','',s)
print(s)

Submission status: Wrong Answer

Solution code:
import re
s=input()
s=re.sub(r'.B+','',s)
print(s)

Submission status: Wrong Answer

Solution code:
import re
s = input()
print(re.sub("[0-1]B","",s).replace("B",""))

Submission status: Wrong Answer

Solution code:
n = input()

n_list = list(n)
result = []
result2 = ''
     
for i in range(len(n)):
    if n_list[i] == 'B':
        if i == 0:
            pass
        elif n_list[i-1] == 'B':
            pass
        else:
            result.pop()
    elif n_list[i] == '0':
        result.append('0')
    elif n_list[i] == '1':
        result.append('1')
    
    result2 = ''.join(result)
    print(result2)

Submission status: Wrong Answer

Solution code:
n = input()

n_list = list(n)
result = []
result2 = ''

for i in range(len(n)):
    if n_list[i] == 'B':
        if i == 0:
            pass
        elif n_list[i-1] == 'B':
            pass
        else:
            result.pop()
    elif n_list[i] == '0':
        result.append('0')
    elif n_list[i] == '1':
        result.append('1')
    
    result2 = ''.join(result)
    print(result2)

Submission status: Wrong Answer

Solution code:
# coding : utf-8

s = input()
display = ""

for i in range(len(s)):
  if s[i] == "0":
    display += "0"
  elif s[i] == "1":
    display += "1"
  elif s[i] == "B":
    if display == "":
      pass
    elif len(display) == 1:
      display = ""
    else:
      display = display.rstrip(s[i - 1])

print(display)

Submission status: Wrong Answer

Solution code:
# coding : utf-8

s = input()
display = ""

for i in range(len(s)):
  if s[i] == "0":
    display += "0"
  elif s[i] == "1":
    display += "1"
  elif s[i] == "B":
    if display == "":
      pass
    elif len(display) == 1:
      display = ""
    else:
      display = display.rstrip()

print(display)

Submission status: Wrong Answer

Solution code:
# coding:utf-8

s = input()
display = ""

for i in range(len(s)):
  if s[i] == "0":
    display += "0"
  elif s[i] == "1":
    display += "1"
  elif s[i] == "B":
    if display == "":
      pass
    else:
      display = display.rstrip()

print(display)

Submission status: Wrong Answer

Solution code:
s=list(input())

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

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
s=s.replace('1B','')
s=s.replace('0B','')
s=s.replace('B','')
print(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())
len_s = len(s)
output = []
for i in range(0,len_s-1):
    if s[i+1] == "B":
        output.append("D")
    else:
        output.append(s[i])
output.append(s[len_s-1])
output2 = [j for j in output if j.isdigit()]
print("".join(output2))

Submission status: Wrong Answer

Solution code:
s = list(input())
len_s = len(s)
output = []
for i in range(0,len_s):
    if s[i] =="B" and s[i-1] == True:
        output[i-1] = "D"
    output.append(s[i])
output2 = [j for j in output if j.isdigit()]
print("".join(output2))

Submission status: Wrong Answer

Solution code:
s = list(input())
len_s = len(s)
output = []
for i in range(0,len_s):
    if s[i] =="b" and s[i-1] == True:
        output[i-1] = "d"
    output.append(s[i])
output2 = [j for j in output if j.isdigit()]
print("".join(output2))

Submission status: Wrong Answer

Solution code:
S = input()
a = S.replace("0B", "")
a = a.replace("1B", "")
ans = a.replace("B", "")
print(ans)

Submission status: Wrong Answer

Solution code:
import re
t = input()
while "B" in t:
    t = t. lstrip("B")
    t = re.sub('.B','', t)
print(t)

Submission status: Wrong Answer

Solution code:
import re
t = input()
while "B" in t:
    t = t. lstrip("B")
    t = re.sub('.B','', t)
print(t)

Submission status: Wrong Answer

Solution code:
import re
s = input()
i = 0
t = re.sub('.B','', s)
u = re.sub('B','',t)
print(u)

Submission status: Wrong Answer

Solution code:
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:-2]
    a = b
print(a)

Submission status: Wrong Answer

Solution code:
s = str(input())

temp = list(map(str,s.split('B')))

res = ''

for i in range(len(temp)-1):
    if temp[i] == '':
        res += temp[i]
    else:
        stemp = temp[i]
        res += stemp[:-1]

if s.endswith('B'):
    print(res)
else:
    res += temp[len(temp)-1]
    print(res)

Submission status: Wrong Answer

Solution code:
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.remove(l[-1])
print(''.join(l))

Submission status: Wrong Answer

Solution code:
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)-2]
print(ans)

Submission status: Wrong Answer

Solution code:
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))

Submission status: Wrong Answer

Solution code:
#インポート
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.rstrip(a[-1])
print(a)

Submission status: Wrong Answer

Solution code:
import queue
q = queue.LifoQueue()
for s in input():
    if s =="B":
        if q.empty():
            continue
        q.get()
    else:q.put(s)
while not q.empty():
    print(q.get(),end="")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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[:i-2]
print(B)

Submission status: Wrong Answer

Solution code:
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[:i-1]
print(B)

Submission status: Wrong Answer

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

main()

Submission status: Wrong Answer

Solution code:
import re
s = input()
s = re.sub('.B', '',s)
print(s)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(s: str):
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    s = next(tokens)  # type: str
    solve(s)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
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":
        t=t[:i-1]

print(t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    sl = list(input())

    print(sl)

    text = ""

    for s in sl:
        if s == "0" or s == "1":
            text = text + s
        elif s == "B":
            if text != "":
                text = text[:-1]

    print(text)

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    sl = list(input())

    print(sl)

    text = ""

    for s in sl:
        if s == "0" or s == "1":
            text = text + s
        elif s == "B":
            text = text[:-1]

    print(text)

Submission status: Wrong Answer

Solution code:
s = input()
ans = []
for i in s:
  if i == "B":
    if ans:
      ans.pop()
  else:
    ans.append(i)
print(*ans)

Submission status: Wrong Answer

Solution code:
s = input()
s = s[::-1]
i = 0
c = 0
ans = ''
while len(s) > i:
    if s[i] == 'B':
        c += 1
    else:
        i += c
        if len(s) > i:
            ans += s[i]
    i += 1

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
str = []
str2 = []
result = ""
flg = 0
for i in S:
    str.append(i)
str.reverse()
for j in range(len(str)):
    if str[j] == "B":
        flg = 1
    else :
        if flg ==0:
            str2.append(str[j])
        flg = 0
for k in str2:
    result += k
print(result)

Submission status: Wrong Answer

Solution code:
S = input()
str = []
str2 = []
result = ""
flg = 0
for i in S:
    str.append(i)
str.reverse()
print(str)
for j in range(len(str)):
    if str[j] == "B":
        flg = 1
    else :
        if flg ==0:
            str2.append(str[j])
        flg = 0
for k in str2:
    result += k
print(result)

Submission status: Wrong Answer

Solution code:
S = input()
str = []
str2 = []
result = ""
flg = 0
for i in S:
    str.append(i)
str.reverse()
for j in str:
    if j == "B":
        flg = 1
        continue
    if flg != 1:
        flg = 0
        str2.append(j)
for k in str2:
    result += k
print(result)

Submission status: Wrong Answer

Solution code:
s=input()

out=[]
for c in list(s):
  if c=='0':
    out.append('0')
  elif c=='1':
    out.append('1')
  else:
    if len(out)>0:
      del out[-1]
print(out)

Submission status: Wrong Answer

Solution code:
s = list(input())
#key =s.copy()
#print(s)
a = []
#count = 0

for i in s:
 # print(s)
  if i == 'B' and s.index(i) == 0:
    pass
  elif i == 'B':
    a = a[:-1]
    #del a[-1]
  else:
    a.append(i)
  
    
print(''.join(a))

Submission status: Wrong Answer

Solution code:
s = list(input())
#print(s)
key = s.copy()
while 'B' in key:
  for n,i in enumerate(key):
    if i=='B' and n>0:
  #    print(n,i)
      del key[n-1]
      del key[n-1]
    elif i=='B' and n==0:
      del key[n]
    
print(''.join(key))

Submission status: Wrong Answer

Solution code:
s = input()
ans=[]
for c in s:
  if s=="0":
    ans.append("0") 
  if s=="1":
    ans.append("1")
  if s=="B":
    if len(ans)==0:
      pass
    else:
      ans.pop()
ans="".join(ans)
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
ans=[]
for c in s:
  if s=="0":
    ans.append(0) 
  if s=="1":
    ans.append(1)
  if s=="B":
    if len(ans)==0:
      pass
    else:
      ans.pop()
ans="".join(ans)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
a = []
n=[s[i] for i in range(len(s))]

for i in range(len(s)): 
    if len(a)>0 and s[i]=="B":
        a[len(a)-1]=""
    elif s[i]=='0':
        a.append('0')
    elif s[i]=='1':
        a.append('1')
answer=""
for i in range(len(a)):
    answer += a[i]

print(answer)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 文字列の入力
S = input()
T = ''
for i in range(len(S)):
	if S[i] == '0':
		T += '0'
		print(T)
	elif S[i] == '1':
		T += '1'
		print(T)
	elif S[i] == 'B':
		T = T[:-1]
		print(T)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 文字列の入力
S = input()
T = ''
for i in range(len(S)):
	print(S[i])	
	if S[i] == '0':
		T += '0'
	elif S[i] == '1':
		T += '1'
	elif S[i] == 'B':
		T = T[:-1]
print(T)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 文字列の入力
S = input()
T = ''
for i in range(len(S)):
	if S[i] == '0':
		T += '0'
	elif S[i] =='1':
		T += '1	'
	else:
		T = T[:-1]
print(T)

Submission status: Wrong Answer

Solution code:
a = input()
b = [i for i in a]
for j in range(1,len(b)):
    if b[j] == 'B':
        try:
            b[j] = ''
            b[j-1] = ''
        except :
            None
for k in range(len(b)):
    if b[k] == 'B':
        try:
            b[k] = ''
        except :
            None
c = ''.join(b)
print(c)

Submission status: Wrong Answer

Solution code:
a = input()
b = [i for i in a]
for j in range(1,len(b)):
    if b[j] == 'B':
        try:
            b[j] = ''
            b[j-1] = ''
        except :
            None
for k in range(len(b)):
    if b[k] == 'B':
        try:
            b[k] = ''
            b[k-1] = ''
        except :
            None
c = ''.join(b)
print(c)

Submission status: Wrong Answer

Solution code:
a = input()
b = [i for i in a]
for j in range(1,len(b)):
    if b[j] == 'B':
        try:
            b[j] = ''
            b[j-1] = ''
        except :
            None
c = ''.join(b)
print(c)

Submission status: Wrong Answer

Solution code:
a = input()
b = [i for i in a]
for j in range(4):
    if b[j] == 'B':
        try:
            b[j] = ''
            b[j-1] = ''
        except :
            None
c = ''.join(b)
print(c)

Submission status: Wrong Answer

Solution code:
nyu=input()
shutu=[]
for i in nyu:
	if i=="0" or "1":
		shutu.append(i)
	else:
		if len(shutu)!=0:
			shutu.pop(-1)
kekka="".join(shutu)
print(kekka)