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:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
import sys
import bisect
import string
import math
def S_():
    return input()
def LS():
    return [i for i in input().split()]
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def NI(n):
    return [int(input()) for i in range(n)]
def NI_(n):
    return [int(input())-1 for i in range(n)]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def LtoS(ls):
    return ''.join([chr(i+97) for i in ls])
YN=['Yes','No']
inf=float('inf')
input=lambda: sys.stdin.readline().rstrip()

ans=0

q=[]
for i in input():
    if i=='B':
        if q:
            q.pop()
    else:
        q+=[i]

print(''.join(q))

Submission status: Accepted

Solution code:
s = input()

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

print(result)

Submission status: Accepted

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

for i in range(len(s)):
    if (s[i] == "B"):
        if(len(a) <= 0):
            continue
        else:
            a.pop()
    else:
        a.append(s[i])
print(''.join(a))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
	S = input()
	S = [s.split()[0] for s in S]
	ans = []
	for i in range(0,len(S)):
		if S[i] == 'B' and len(ans)>0:
			ans.pop()
		elif S[i] != 'B':
			ans.append(S[i])

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

Submission status: Accepted

Solution code:
s = 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:
s=input() 
a=[]
for i in s:
    if i != "B":
        a.append(i)
    else:
        if len(a) != 0:a.pop()
print(''.join(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inputs = input()
answer = ''

for s in inputs:
    if s == '0':
        answer = answer + '0'
    elif s == '1':
        answer = answer + '1'
    elif s == 'B' and answer == '':
        answer = answer + ''
    elif s == 'B' and answer != '':
        answer = answer[:-1]
print(answer)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    input_str = input()
    ans = []
    for s in input_str:
        if s == "0":
            ans.append("0")
        elif s == "1":
            ans.append("1")
        else:
            if len(ans) == 0:
                continue
            else:
                ans.pop()

    print("".join(ans))

Submission status: Accepted

Solution code:
#文字列の入力
s = input()

f = ''

for i in s:
    if i == '0' or i == '1':
        f += i
    elif i == 'B':
        f = f[:-1]
    else:
        continue

print(f)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
s=input().strip()
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:
import sys
import queue
bbn=1000000007
	
#+++++

		
def main():
	s = input()
	ll=[]
	for c in s:
		if c == 'B':
			if len(ll) != 0:
				ll.pop(-1)
				
		else:
			ll.append(c)
			
	ret=''.join(ll)
	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
L=""
N=str(input())
for i in N:
    if i==str(0):
        L+="0"
    elif i==str(1):
        L+="1"
    elif i==str("B"):
        L=L[0:-1]
print(L)

Submission status: Accepted

Solution code:
# coding: utf-8
s = 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:
arr = input()
arr = list(str(arr))

stack = []
for i in range(len(arr)):
    if arr[i] == '0' or arr[i] == '1':
        stack.append(arr[i])
    elif arr[i] == 'B' and len(stack) != 0:
        stack.pop(-1)

print(''.join(stack))

Submission status: Accepted

Solution code:
chars = input()

ans = []
for c in chars:
    if c in ['0', '1']:
        ans.append(c)
    elif len(ans) != 0:
        ans.pop(-1)

print(''.join(ans))

Submission status: Accepted

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

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

print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    ss=STR()
    ans=[]
    for s in ss:
        if s=='0'or s=='1':
            ans.append(s)
        elif s=='B':
            if len(ans)>0:
                d=ans.pop(-1)
                #print(d)
            else:
                pass
    print(*ans,sep='')
            
if __name__ == '__main__':
    do()

Submission status: Accepted

Solution code:
S = list(input())
t = []
N = len(S)

for i in range(N):
  if S[0] == "B":
    S.pop(0)
    if len(t) > 0:
      t.pop(-1)
  else:
    t.append(S[0])
    S.pop(0)

print(*t, sep = "")

Submission status: Accepted

Solution code:
s = input()

while(s.count('B')):
    if s.count('0B'):
        s = s.replace('0B','')
    elif s.count('1B'):
        s = s.replace('1B','')
    else:
        s = s.replace('B','')   
        
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:



class KeySeq:

    def __init__(self):
        self.seq = []

    def _add_char(self, ch):
        if ch in ['0', '1']:
            self.seq.append(ch)

    def _backspace(self):
        self.seq = self.seq[:len(self.seq)-1]

    def apply(self, ch):
        if ch == 'B':
            self._backspace()
        else:
            self._add_char(ch)

    def __str__(self):
        return ''.join(self.seq)

keyseq = KeySeq()
s = input()
for ch in list(s):
    keyseq.apply(ch)

print(keyseq)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for s in S:
    if s == '1':
        res.append('1')
    elif s == '0':
        res.append('0')
    else:
        if not res:
            continue
        else:
            res.pop()

print(''.join(res))

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
ans = []
for i in range(len(s)):
    ans.append(s[i])
j=1
while True:
    if ans[0]=="B":
        ans.pop(0)
    elif j>=len(ans):
        break
    elif ans[j]=="B":
        ans.pop(j-1)
        ans.pop(j-1)
        j-=1
    else:
        j+=1
print(*ans,sep="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass

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

Submission status: Accepted

Solution code:
s=input()
t=[]
for i in s:
    if i=="0":
        t.append(0)
    elif i=="1":
        t.append(1)
    else:
        if len(t)>0:
            t.pop(-1)
print(*t,sep="")

Submission status: Accepted

Solution code:
s = input()

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

print(t)

Submission status: Accepted

Solution code:
s = input()

ans = []

for i in s:
    if i == "0":
        ans.append("0")
    elif i == "1":
        ans.append("1")
    elif i == "B" and len(ans) == 0:
        ans
    else:
        ans.pop()
print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
ans = []
s = list(input().rstrip())
for i in s:
    if i == "0":
        ans.append("0")
    elif i == "1":
        ans.append("1")
    elif len(ans) > 0:
        ans.pop()
print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(len(s)):

	if s[i] == "B" and len(ans) >= 1:
		ans.pop(-1)
	elif s[i] == "0":
		ans.append("0")
	elif s[i] == "1":
		ans.append("1")

print("".join(ans))

Submission status: Accepted

Solution code:
comlist = list(input())
a = []

for i in comlist:
  if i == "B":
    if not len(a) == 0:
      del a[-1]
  else:
    a.append(i)


print("".join(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from collections import deque

s = list(input())

ans = deque()
for i in s:
    if i == "0":
        ans.extend("0")
    elif i == "1":
        ans.extend("1")
    else:
        if len(ans) == 0:
            pass
        else:
            ans.pop()

#print(ans)

print("".join(ans))

Submission status: Accepted

Solution code:
s = str(input())
lst = []

for i in range(len(s)):
    if s[i]=='B':
        if len(lst)!=0:
            del lst[-1]
        else:
            continue
    else:
        for j in range(2):
            if int(s[i])==j:
                lst.append(str(j))

print(''.join(lst))

Submission status: Accepted

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

res = ""
for c in s:
    if c=="B" and len(res)>0:
        res = res[:-1]
    elif c!="B":
        res += c

print(res)

Submission status: Accepted

Solution code:
s = list(input())

sStack = []

for ts in s:
  if ts == 'B':
    #なにか入っていたらpop
    if sStack:
      sStack.pop()
  else:
    sStack.append(ts)

print(''.join(sStack))

Submission status: Accepted

Solution code:
s=input()

n=""
for i in s:
  if i in ["0","1"]:
    n=n+i
  elif i=="B" and n=="":
    pass
  else:
    n=n[0:-1]

print(n)

Submission status: Accepted

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

for s in S:
    if s != 'B':
        stuck.append(s)
    elif s == 'B' and len(stuck) != 0:
        stuck.pop()

print(*stuck, sep='')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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[:-1]
        else:
            ans = ''

print(ans)

Submission status: Accepted

Solution code:
s = input()

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

print(ans)

Submission status: Accepted

Solution code:
kekka = ""

for i in input():
    
    if i=="B":
        kekka=kekka[:-1]

    else:
        kekka=kekka+i
    
print(kekka)

Submission status: Accepted

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

kekka = []

for i in range(len(s)):
    
    if s[i]!="B":
        kekka.append(s[i])

    elif kekka!=[]:
        kekka.pop()
    
print(''.join(kekka))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
ans = [None]*len(s)
n = 0
for c in s:
    ans[n] = c
    n += 1
    if c=='B': n = max(0, n-2)
print(*ans[:n], sep='')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(map(str,input()))
ans = ""
count = 0
for i in s:
    if i == "0":
        ans += "0"
        count += 1
    elif i == "1":
        ans += "1"
        count += 1
    else:
        if count == 0 :
            continue
        else:
            ans = ans[:-1]
            count+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
s_list = [s[_] for _ in range(len(s))]

output = list()
for c in s_list:
  if c == '0':
    output.append('0')
  elif c == '1':
    output.append('1')
  else:
    if len(output) > 0:
      output.pop()
print(''.join(output))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

ans = ""
for i in range(len(S)):
    if S[i] == "B":
        if ans == "":
            pass
        else:
            ans = ans[:-1]
    elif S[i] == "0":
        ans += "0"
    elif S[i] == "1":
        ans += "1"

print(ans)

Submission status: Accepted

Solution code:
#入力
a = input()
#空のリスト
ans = []
for c in a:#cが0文字目からaまで
    if c != "B": #Bでなければアペンド
        ans.append(c)
    else:
        if len(ans) != 0 :ans.pop()#Bであってさらにリストがからでなければpop
 
print("".join(ans)) #listをくっつけた文字にできる

Submission status: Accepted

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

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

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:
d=""
for s in input():
    if s=="B":d=d[:-1]
    else:d+=s
print(d)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
a=[]
for i in range(len(s)):
    if s[i]=='0' or s[i]=='1':
        a.append(s[i])
    elif len(a)>0:
        del a[len(a)-1]

print(''.join(a))

Submission status: Accepted

Solution code:
s=list(input())

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

Submission status: Accepted

Solution code:
s = input()

ans = []
for x in s:
   if (x == '0'):
      ans.append('0')
   elif (x == '1'):
      ans.append('1')
   elif (x == 'B' and len(ans) > 0):
      ans.pop(-1)

print(''.join(ans))

Submission status: Accepted

Solution code:
s = input()
S = list(s)
ans = []
for i in range(len(s)):
    if S[i] == 'B':
        if ans:
            ans.pop()
    else:
        ans.append(S[i])
print(''.join(ans))

Submission status: Accepted

Solution code:
def typing(s, ans):
    for i in range(len(s)):
        if s[i] == 'B' and 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: Accepted

Solution code:
def typing(s, 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()
        else:
            continue

    print(''.join(ans))

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

Submission status: Accepted

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

    print(ans)

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

Submission status: Accepted

Solution code:
sl = list(input())

ans = []

for s in sl:
   if s != "B":
      ans.append(s)
   else:
      if len(ans) > 0:
         ans.pop()

print("".join(ans))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#N, L = map(int, input().split())
s = str(input())

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

print (ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()
m = []
for i in s:
    if i == "0":
        m.append(i)
    elif i == "1":
        m.append(i)
    else:
        try:
            m.pop(-1)
        except:
            continue
answer = "".join(m)
print(answer)

Submission status: Accepted

Solution code:
S=input()
stack =[]
for s in S:
    if not stack and s=='B':
      #continue文は、for文やwhile文のブロック処理中に使用。
      #continue文を使用すると、それ以降の処理を行わず、for文やwhile文のブロックの先頭に戻る。
      continue
    elif s=='B':
        stack.pop()
    else:
        stack.append(s)
#''.join(list)でlistを文字列化
print(''.join(stack))

Submission status: Accepted

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

kekka = []

for i in range(len(s)):
    
    if s[0]=="B":
        pass
            
    if s[i]=="B" :
        if not kekka==[]:
            kekka.pop()
    else:
        kekka.append(s[i])

print(''.join(kekka))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
*s, = input()
ans = []
for x in s:
    if x == '0':
        ans.append('0')
    elif x == '1':
        ans.append('1')
    else:
        if ans:
            ans.pop()
print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import fractions

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

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
import sys


def main(argv=sys.argv):
  
  code = list(input())
  list1 = []
  
  for i in range(len(code)):
    if code[i] == '0':
      list1.append(0)
      
    elif code[i] == '1':
      list1.append(1)
      
    elif len(list1) == 0 and code[i] == 'B':
      pass
      
    elif code[i] == 'B':
      list1.pop(-1)     
      
  print(''.join(map(str, list1)))
    
  
  return 0


if __name__ == '__main__':
  sys.exit(main())

Submission status: Accepted

Solution code:
s = input()

ans =''

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

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
import sys


def main(argv=sys.argv):

    inputs_ = list(input())

    string_ = []

    for input_ in inputs_:

        if input_ == 'B':

            if not string_ == []:

                string_.pop(-1)

        else:

            string_.append(input_)

    print(''.join(string_))

    return 0


if __name__ == '__main__':
    sys.exit(main())

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:
# coding: utf-8
import sys


def main(argv=sys.argv):
  
    inputs_ = list(input())

    string_ = []

    for input_ in inputs_:

        if input_ == 'B':

            if not string_ == []:
              
                string_.pop(-1)

        else:

            string_.append(input_)

    print(''.join(string_))

    return 0


if __name__ == '__main__':
    sys.exit(main())

Submission status: Accepted

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

for i in s:
  #print("output:", output)
  if (output == "") and (i == "B"):
    pass
  elif i == "0":
    output = output + "0"
  elif i == "1":
    output = output + "1"
  elif i == "B":
    output = output[:-1]

print(output)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

answer=""

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

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()
out = ""

for i in s:
    if i == "0" or i == "1":
        out += i
    else:
        out = out[:-1]

print(out)

Submission status: Accepted

Solution code:
s = input()
l = list(s)
i = 0
r = []
while i < len(l):
    if len(r) == 0:
        if s[i] == 'B':
            pass
        else:
            r.append(s[i])
    else:
        if s[i] == 'B':
            r.pop()
        else:
            r.append(s[i])
    i += 1
print(''.join(r))

Submission status: Accepted

Solution code:
S = list(input())
final_str = []
for key in S: 
    if key == "B":
      final_str = final_str[:-1]
    else:
      final_str.append(key)
print(''.join(final_str))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
text = ""
for s in S:
  if(s=="1" or s=="0"):
    text = text + s
  else:
    text = text[:len(text)-1]
print(text)

Submission status: Accepted

Solution code:
s = input()

ans = ""

for i in s:
    if i == "0":
        ans += i
    elif i == "1":
        ans += i
    else:
        if ans:
            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:
      ans.pop()
  else:
    ans.append(s[i])

print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ans = []
for x in s:
    if x == '0' or x == '1':
        ans.append(x)
    elif x == 'B' and ans:
        ans.pop()
print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
hoge=input()
n=len(hoge)
ans=''
for i in hoge:
  if i == 'B':
    l=len(ans)
    if l==0:
      pass
    else:
      ans=ans[0:l-1]     
  else:
    ans=ans+i
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print( sol )

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 043 - B
# -*- encoding: UTF-8 -*-
s = input().upper()

edited = []

for c in s:
  if c == "0" :
    edited.append("0")
  elif c == "1" : 
    edited.append("1")
  elif c == "B" :
    if len(edited) > 0:
      edited.pop()

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

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")
    elif s[i] == "B":
        if len(ans) != 0:
            ans.pop()
print("".join(ans))

Submission status: Accepted

Solution code:
s = list(input())
ans = []
for i in s:
  if i == "0":
    ans.append(i)
  elif i == "1":
    ans.append(i)
  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' and not ans:
        pass
    elif i == 'B' and ans:
        ans = ans[:-1]
    else:
        ans += i
        
print(ans)

Submission status: Accepted

Solution code:
# B問題
s = input()
out = []
for i in s:
  if i != "B":
    out.append(i)
  else:
    if len(out) != 0:
      out = out[:-1]
print("".join(out))

Submission status: Accepted

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

s = input()
ans = ""
for c in s:
    if c in ["0", "1"]:
        ans += c
    elif ans:
        ans = ans[:-1]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#yandy
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=list(input())
t=[]
for i in s:
  if i=="0":
    t.append("0")
  elif i=="1":
    t.append("1")
  else:
    if t==[]:
      pass
    else:
      t.pop()
mojiretsu = ''.join(t)
print (mojiretsu)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC043 B

s = input()
word = ''

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

print(word)

Submission status: Accepted

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

Submission status: Accepted

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

print("".join(ans))