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: Accepted

Solution code:
a=''
for c in input():
	if c=='B':
		if len(a)>0:
			a=a[:-1]
	else:
		a+=c
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A=str(input())
A=list(A)
B=[]
for i in A:
  if i=="0":
    B.append("0")
  elif i=="1":
    B.append("1")
  elif i=="B":
    B=B[:-1]
print(''.join(B))

Submission status: Accepted

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


print(output)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()

out = ''

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

print(out)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
s = list(s)
ans = []

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(raw_input())

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

print ''.join(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import deque

s = input()

q = deque()

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

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

print()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

Solution code:
s = raw_input()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(''.join(ans))

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
ans = []
for i in range(len(s)):
    if s[i] == '0':
        ans.append("0")
    elif s[i] == '1':
        ans.append("1")
    elif s[i] == 'B':
        if len(ans) > 0:
            ans.pop()
for a in ans:
    print(a,end="")

Submission status: Accepted

Solution code:
s = input()

res = ''

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
STR = input()

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

    return res

print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()
A = []
for i in range(len(S)):
    if S[i] == '0':
        A.append('0')
    elif S[i] == '1':
        A.append('1')
    else:
        if len(A) != 0:
            A.pop(-1)
        else:
            pass
print(''.join(A))

Submission status: Accepted

Solution code:
s = input()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np

string = list(input())

stack = []

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

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

print(answer + '\n')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(l_str)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
# A,B,C = [int(n) for n in input().split()]
# N = int(input())
S = str(input())
# T = str(input())
ans = ""
for s in S:
    if s == "B":
        ans = ans[:-1]
    else:
        ans += s

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = str(input())

b = list(a)

c = len(b)

strs = []

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

print(''.join(strs))

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(text)

Submission status: Accepted

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":
        if len(t) != 0:
            k = list(t)
            del k[-1]

            t = ''.join(k)
            #t.pop(-1)
print(t)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(s[::-1])

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
s = input()

result = list()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


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

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(text)

Submission status: Accepted

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

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

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

print(display)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
a=''
for i in s:
  if i=='0' or i=='1':
    a+=i
  else:
    if len(a)!=0:
      a=a[:len(a)-1]
print(a)

Submission status: Accepted

Solution code:
# 

s=input() #0,1,Bからなる文字列を入力
a="" #aは求める文字列
l=0 #lはaの長さ

for i in s:
    if i=="B": #iがBなら末尾を消去
        a=a[0:l-1] 
        l-=1
    else: #iがB出なければaの末尾にiを付ける
        a+=i
        l+=1
    if l<0: #lは負にならない
        l=0

print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def listToString(_list, split=""):
    maped_list = map(str, _list)  # mapで要素すべてを文字列に
    mojiretu = split.join(maped_list)
    return mojiretu


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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
ANS=""
for s in S:
    if s=="0":
        ANS+="0"
    elif s=="1":
        ANS+="1"
    else:
        ANS=ANS[:-1]

print(ANS)

Submission status: Accepted

Solution code:
s=input()
ans=[]
for i in s:
    if len(ans) and i=='B': ans.pop()
    elif i!='B': ans.append(i)
print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# input
s = input()

ans = ''

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

print(ans)

Submission status: Accepted

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

print(output)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ans = []

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

Submission status: Accepted

Solution code:
s = input()

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

print("".join(l))

Submission status: Accepted

Solution code:
s=input()

s=list(s)

b=[]

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

#b.reverse()

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

print(c)

Submission status: Accepted

Solution code:
s = input()

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

print(out_str)

Submission status: Accepted

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

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

Submission status: Accepted

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