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:
s = list(input())
ans = ''
for i in s:
	if i == 'B' and len(ans) > 0:
		ans = ans[:-1]
	elif i == '0' or i == '1':
		ans = ans + i
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC043B - バイナリハックイージー / Unhappy Hacking (ABC Edit)
s = input()
ans = ""
for i in s:
    if i != "B":
        ans += i
    else:
        ans = ans[:-1]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(w)

Submission status: Accepted

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

print(W)

Submission status: Accepted

Solution code:
s=input()
n=len(s)
d=[]
for i in range(n):
  if'B'==s[i]:
    d.append(d[-1][:-1]if i>0else '')
  else:
    d.append(d[-1]+s[i]if i>0else s[i])
print(d[-1])

Submission status: Accepted

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

Submission status: Accepted

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

s = list(input())

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

print(strng)

Submission status: Accepted

Solution code:
def main():
	s = input()
	ans = ""
	for c in s:
		if c == "B" and ans:
			ans = ans[:-1]
		elif c != "B":
			ans += c
	print(ans)

if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
x = input()

for i in range(11):
  x=x.replace('1B', '')
  x=x.replace('0B', '')

x=x.replace('B', '')

print(x)

Submission status: Accepted

Solution code:
s = list(input())

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

print(ans)

Submission status: Accepted

Solution code:

s = str(input())
ret = ''
for c in s:
  if c=='B':
    if ret!='':
      ret = ret[:-1]
  else:
    ret += c
print(ret)

Submission status: Accepted

Solution code:
import sys
from collections import Counter

s = input()
ans = ''

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = str(input())
n = len(s)

editer = []
for i in range(n):
    if s[i] != "B":
        editer.append(s[i])
    else:
        if len(editer) != 0:
            editer.pop(-1)
print("".join(editer))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

disp = []
for s in S:
    if s == "B":
        if len(disp) > 0:
            disp.pop()
        continue
    disp.append(s)
print("".join(disp))

Submission status: Accepted

Solution code:
S = input()

res = []
for s in S:
    if s == "B":
        if len(res) > 0:
            res = res[:-1]
    else:
        res.append(s)

print(''.join(res))

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"
    elif s[i] == "B":
        ans = ans[:len(ans)-1]
print(ans)

Submission status: Accepted

Solution code:
s = input()
pre = []
for i in s:
    if i == '0' or i == '1':
        pre.append(i)
    else:
        if pre != []:
            del pre[-1]

ans = ''
for i in pre:
    ans += i
print(ans)

Submission status: Accepted

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

for i in s:
    if i == "B":
        if stack!=[]:stack.pop()
    else:
        stack.append(i)
result="".join(stack)
print(result)

Submission status: Accepted

Solution code:
s=input()
from collections import deque
stack=deque([])
for c in s:
    if c == 'B':
        if stack:
            stack.pop()
    else:
        stack.append(c)
print(''.join(stack))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(''.join(ans))

Submission status: Accepted

Solution code:

def read_input():
    s = input().strip()
    return s


def submit():
    s = read_input()

    result = []
    for c in s:
        if c == 'B':
            result = result[:-1]
        else:
            result.append(c)

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


if __name__ == '__main__':
    submit()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

def solve(S):
    A = []
    for i in range(len(S)):
        if(S[i]=="0" or S[i]=="1"):
            A.append(S[i])
        elif(len(A)>0 and S[i]=="B"):
            A.pop()
    print("".join(A))
    
if __name__ == '__main__':
    S = input()
    
    solve(S)

Submission status: Accepted

Solution code:
s=input()

output=[]

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

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

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    S = str(input().strip())
    ans = []
    for s in S:
        if s == '0':
            ans.append('0')
        elif s == '1':
            ans.append('1')
        else:
            if len(ans) > 0:
                ans.pop()

    print(*ans, sep='')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = input()

s = ''
for each in n:
    if each == '0' or each == '1':
        s += each
    else:
        s = s[:-1]
print(s)

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:
from sys import stdin
input=stdin.readline().rstrip()
output_list=[]
for i in range(len(input)):
  if input[i]!="B":
    output_list.append(input[i])
  else:
    if len(output_list)!=0:
      output_list.pop(-1)
      
#print(output_list)
output="".join(output_list)
print(output)

Submission status: Accepted

Solution code:
# -*- coding utf-8 -*-
s=input()
ans=""
for i in range(len(s)):
    if s[i]=="B":
        ans=ans[:-1]
    elif s[i]=="1":
        ans+="1"
    elif s[i]=="0":
        ans+="0"


print(ans)

Submission status: Accepted

Solution code:
s = input()
o = []
for i in s:
  if i == 'B':
    if len(o) > 0:
      o.pop()
  else:
    o.append(i)
print(''.join(o))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#43
s = input()
while "0B" in s or "1B" in s:
    s = s.replace("0B","").replace("1B","")
s = s.replace("B","")
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 入力
s=input()

a=''
for x in s:
  if x=='0':
    a+='0'
  elif x=='1':
    a+='1'
  else:
    # 文字列が空でない場合、末尾を削除
    if a!='':
      a=a[:-1]

# 出力
print(a)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

s = input()

x = ""
for i in s:
    if i != "B":
        x = x + i
    else:
        x = x[:-1]

print(x)

Submission status: Accepted

Solution code:
c = list(input())
ans = []
for i in range(len(c)):
    if c[i] == '0':
        ans.append('0')
    elif c[i] == '1':
        ans.append('1')
    elif len(ans) != 0:
        del ans[-1]
    else:
        continue

print (''.join(ans))

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')
    elif len(ans)!=0:
        del ans[-1]
    else:
        continue
print(''.join(ans))

Submission status: Accepted

Solution code:
s = input()
n= len(s)
a=[]

for i in range(n):
    if s[i]!='B':
        a.append(s[i])
    else:
        if a!=[]:
            del a[-1]
print(''.join(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = input()
s = []
for i in x:
  if i == 'B':
    if len(s) == 0:
      continue
    del s[-1]
  else:
    s.append(i)
print(''.join(s))

Submission status: Accepted

Solution code:
s=input()
s=list(s)
l=[]
ls=len(s)
for i in range (ls):
    if s[i]=='1':
        l.append(1)
    elif s[i]=='0':
        l.append(0)
    else:
        if len(l)==0:
            l=l
        else:
            l.pop()
ans=""
for i in range(len(l)):
    ans=ans+str(l[i])
print(ans)

Submission status: Accepted

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

s = list(input())
str = ""

for x in s:
    if x != "B":
        str += x
    else:
        str = str[:-1]

print(str)

Submission status: Accepted

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

s=list(input())
ans=""

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding utf-8  -*-
s=str(input())

ans=""

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

Submission status: Accepted

Solution code:
answer =[]

for letter in input():
  if letter=="1":
    answer.append("1")    
  elif letter=="0":
    answer.append("0")    
  elif letter=="B" and len(answer)>0:
    answer.pop()
    
print("".join(answer))

Submission status: Accepted

Solution code:
s = list(input())
t = ""
for s_ in s:

    if s_ != "B":
        t += s_
    else:
        t = t[:-1]
print(t)

Submission status: Accepted

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

s = str(input())
ans = ""

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def unhappy_hacking(s: str) -> str:
    display = ''

    for key in s:
        if key == '0':
            display += '0'
        elif key == '1':
            display += '1'
        else:  # Backspace
            display = display[:-1]

    return display


if __name__ == "__main__":
    s = input()
    ans = unhappy_hacking(s)
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
# s = "01B0"
# print(s[0])

ans = []
for key in range(len(s)):

    if s[key] == "0" or s[key] == "1":
        ans.append(s[key])
    if s[key] == "B" and len(ans) > 0:
        ans.pop(-1)
print("".join(ans))

Submission status: Accepted

Solution code:
s = input()

ans = ''
for x in s:
    if x in ['0', '1']:
        ans += x
    else:
        ans = ans[:-1]

print(ans)

Submission status: Accepted

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

while len(hoge):
  if(hoge[0]=="0"):
    ans.append(0)
    hoge=hoge[1:]
  elif(hoge[0]=="1"):
    ans.append(1)
    hoge=hoge[1:]
  else:
    if(len(ans)>0):
      ans=ans[:-1]
    hoge=hoge[1:]

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n =input()
m = ''
for i in range(len(n)):
        if n[i] == 'B':
                if not m:
                        print('')
                else:
                        m= m[:-1]
        else:
         m += n[i]
print(m)

Submission status: Accepted

Solution code:
from sys import stdin
input = stdin.readline
s = input().rstrip()
ans = []
for i in s:
	#print(ans)
	if i == "0":
			ans.append("0")
	elif i == "1":
			ans.append("1")
	else:
		if not ans == []:
			ans.pop(-1)
print("".join(ans))

Submission status: Accepted

Solution code:
a = [str(x) for x in input()]

N = len(a)
b = []

for i in range(N):
    if a[i] == "0":
        b.extend("0")
        
    elif a[i] == "1":
        b.extend("1")
        
    else:
        if len(b) == 0:
            pass
        else:
            b.pop(-1)
            

print("".join(b))

Submission status: Accepted

Solution code:
s = input()

res = ""
for x in s:
    if x =="B":
        res = res[:-1]
    else:
        res += x

print(res)

Submission status: Accepted

Solution code:
s = input()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
"""
n = I()
print((n*(n+1))//2)
"""
#B
s = S()
ans = []
for i in s:
    if i == "0":
        ans.append(0)
    if i == "1":
        ans.append(1)
    if i == "B" and ans:
        ans.pop(-1)
for i in ans:
    print(i,end = "")
print()
#C

#D
"""
s = S()
l = len(s)
for i in range(l-1):
    if s[i] == s[i+1]:
        print(i+1,i+2)
        quit()
for i in range(l-2):
    if s[i] == s[i+2]:
        print(i+1,i+3)
        quit()
print(-1,-1)
"""

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce

def main():
    # 一文字のみを読み込み
    # s = input().rstrip().split(' ')
    
    # スペース区切りで標準入力を配列として読み込み
    # s = input().rstrip().split(' ')

    # 位置文字ずつ標準入力を配列として読み込み
    # s = list(input().rstrip())
    s = list(input().rstrip())
    ans = []
    i = 0
    for char in s:
        if char=='0' or char=='1':
            ans.append(char)
        elif char=='B' and len(ans) > 0:
            ans.pop()
    
    print(''.join(ans))    
   
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

for x in ans:
    print(x,end='')
print()

Submission status: Accepted

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

for i in range(len(S)):
    if S[i] == 'B':
        try:
            del ans[-1]
        except IndexError:
            pass
    else:
        ans.append(S[i])

for x in ans:
    print(x,end='')
print()

Submission status: Accepted

Solution code:
S = list(input())
i = 0
while 'B' in S:
    if S[i] == 'B':
        if i == 0:
            del S[0]
            i = 0
            continue
        else:
            del S[i-1]
            del S[i-1]
            i = 0
            continue
    i += 1
for x in S:
    print(x, end='')
print()

Submission status: Accepted

Solution code:
s = input()

res = ""
for x in s:
    if x =="B":
        res = res[:-1]
    else:
        res += x

print(res)

Submission status: Accepted

Solution code:
w = input()
res = []
for i in w:
    if i =='1':
        res.append(i)
    elif i == '0':
        res.append(i)
    elif len(res) > 0:
        res.pop()
    else:
        pass
print(''.join(res))

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
s_list = list(s)
count = s.count('B')
for _ in range(count):
  ind = s_list.index('B')
  if ind > 0:
    s_list[ind-1] = ''
  s_list[ind] = ''
  s = ''.join(s_list)
  s_list = list(s)
s = ''.join(s_list)
print(s)

Submission status: Accepted

Solution code:
s = input()

answer = ''
for i in s:
    if i == '1' or i == '0':
        answer += i
    elif len(answer) > 0:
        answer = answer[:-1]

print(answer)

Submission status: Accepted

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

print(res)

Submission status: Accepted

Solution code:
r = []
for c in input():
	if c == "B":
		if r:
			r.pop()
	else:
		r.append(c)
print(*r, sep="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)

ans = ''

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

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
# coding: UTF-8

ss = input()

text = []
for s in ss:
    if s == 'B':
        if text != []:
            text.pop(-1)
    else:
        text.append(s)

print(''.join(text))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
String = input()
result = ''
for char in String:
    if char == '0' or char == '1':
        result += char
    elif char == 'B':
        result = result[:-1]
print(result)

Submission status: Accepted

Solution code:
String = input()
result = ''
for char in String:
    if char == '0':
        result += char
    elif char == '1':
        result += char
    elif char == 'B':
        result = result[:-1]
print(result)

Submission status: Accepted

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

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

print("".join(ans))

Submission status: Accepted

Solution code:
# ABC 043 B

S =input()
ANS = ""
for _ in S:
    if _ =="B":
        ANS =ANS[:-1]
    else:
        ANS +=_
print(ANS)

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
from operator import itemgetter
#以下てんぷら
def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")

def ip():
    return int(input())

rem = pow(10,9)+7

#n = ip()                                     #入力整数1つ
#x,y= (int(i) for i in input().split())       #入力整数横2つ以上
#a = [int(i) for i in input().split()]        #入力整数配列
a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[input() for i in range(x)]    #入力セット(整数改行あり)(2/2)

#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
#こっから本文
s = []
for i in range(len(a)):
    if a[i] == 'B' :
        if len(s) : s.pop(len(s)-1)
    else : s.append(a[i])
print(''.join(s))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
string = []
S = input()
for i in S:
    if i == '0':
        string += '0'
    elif i == '1':
        string += '1'
    elif i == 'B':
        if len(string) == 0:
            pass
        else:
            del string[-1]
print(''.join(string))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

ans = []

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

print(''.join(ans))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
list=list(input())
words=[]
word=""
for i in list:
  if i=="0" or i=="1":
    words.append(i)
  else:
    if words==[]:
      pass
    else:
      del words[-1]
for i in words:
  word+=i
print(word)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    s = input() # 入力文字列
    out =''
    for i in s:
        if (out=='')and(i=='B'):
        # outが空かつbackspaceのときはなにもしない
            pass
        elif (i=='B'):
            out = out[:-1] # 最後の文字列[-1]までを代入，pyでは[0:n]のときn-1までをいれる
        else:
            out = out + i
    print(out)
main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

S = input()[:-1]
ans = []
for c in S:
    if c == "B":
        if ans:
            ans.pop(-1)
    else:
        ans.append(c)
print("".join(ans))

Submission status: Accepted

Solution code:
s = list(str(input()))
lis = []
a = ""


for i in range(len(s)):
        if s[i] == "B":
                if len(lis) == 0:
                        continue
                else:
                        lis.pop()
        elif s[i] == "1":
                lis.append("1")
        else:
                lis.append("0")

for j in range(len(lis)):
        a = a + lis[j]

print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

print(ans)

Submission status: Accepted

Solution code:
""" AtCoder """

s = input()
ans = ''

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

print(ans)

Submission status: Accepted

Solution code:
#n=int(input())
#li=input().split()
#li=list(map(int,input().split()))
n=input()
ans=""
for i in range(len(n)):
    if n[i]=="0":
        ans+="0"
    elif n[i]=="1":
        ans+="1"
    elif n[i]=="B":
        if ans=="":
            pass
        else:
            ans=ans[:-1]

print(ans)

Submission status: Accepted

Solution code:
S = list(input().rstrip())
r = []
for i in range(len(S)):
    if S[i] == '0':
        r.append('0')
    elif S[i] == '1':
        r.append('1')
    elif S[i] == 'B':
        if 0 < len(r):
            del r[-1]


print(''.join(r))