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

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

print(e)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ans = []

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

print("".join(ans))

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.pop(-1)
print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
res = ''

for c in input():
    if c == 'B':
        if len(res):
            res = res[:-1]
    else:
        res += c

print(res)

Submission status: Accepted

Solution code:


def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    L=[]
    s=input()
    for i in range(len(s)):
        if s[i]=="0":
            L.append(0)
        elif s[i]=="1":
            L.append("1")
        else:
            if len(L)>=1:
                L.pop()
                
    print(''.join(map(str,L)))
                

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n= list(input())
str=''
for text in n:
	if text == 'B' and len(text) > 0:
		str = str[:-1]
	else:
		str = str + text
print(str)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
S = []
for i in range(len(s)):
    S.append(s[i])
j = 0

while True:
    if S[j] == "B" and j != 0:
        del S[j - 1]
        del S[j - 1]
        j = 0
    elif S[j] == "B" and j == 0:
        del S[j]
    else:
        if j == len(S) - 1 or len(S) == 1:
            break
        j = j + 1

print("".join(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC043.B
s = input()
L = []

def kan(a):
    if a =='0':
        L.append('0')
    elif a =='1':
        L.append('1')
    else:
        if L !=[]:
            L.pop()
for b in s:
    kan(b)

c =''
for d in L:
    c +=d
print(c)

Submission status: Accepted

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

def sousa(x):
    if x=="0":
        ans.append("0")
    if x=="1":
        ans.append("1")
    if x=="B":
        if ans!=[]:
            ans.pop()

for c in s:
    sousa(c)

x=""
for c in ans:
    x+=c
print(x)

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 len(ans) != 0: ans.pop()
for i in ans:
  print(i,end = "")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
data =[]
for i in s:
  if i=="0":
    data.append(0)
  elif i=="1":
    data.append(1)
  else:
    if data!=[]:
      del data[-1]
 #joinはリストが文字列のみ
data = map(str,data)
print(''.join(data))

Submission status: Accepted

Solution code:
import sys
#input = sys.stdin.readline
input = sys.stdin.buffer.readline

# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
import numpy as np


def main():
	s=input().rstrip().decode("utf-8")
	ans=""
	for i in s:
		if i=="B":
			try:
				ans=ans[:-1]
			except:
				pass
		else:
			ans=ans+i
	print(ans)










if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
def main():

    s = list(input())
    now = 0
    ans = [''] * 10
    for i, ss in enumerate(s):
        if ss == '0':
            ans[now] = '0'
            now += 1
        elif ss == '1':
            ans[now] = '1'
            now += 1
        else:
            now -= 1
            now = max(0,now)
            ans[now] = ''
    strans = ''
    for i, a in enumerate(ans):
        if a == '':
            print(strans)
            return
        else:
            strans += a
    print(strans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a=list(input())
from collections import deque
d=deque()
for i in a:
    if i=="0" or i=="1":
        d.append(i)
    else:
        if len(d)==0:
            continue
        d.pop()
print(''.join(list(d)))

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc043/tasks/abc043_b

s=input()

res=[]
for e in s:
    if e=='B':
        if res:
            res.pop()
        else:continue
    else:
        res.append(e)
print(*res,sep='')

Submission status: Accepted

Solution code:
S=input()
L=[]
for i in range(len(S)):
	if S[i]=="1":
		L.append(1)
	elif S[i]=="0":
		L.append(0)
	elif S[i]=="B":
		L=L[0:-1]
for i in range(len(L)):
	print(L[i],end="")
print()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
from collections import deque

def solve():
    input = sys.stdin.readline
    s = input().strip("\n")
    q = deque()

    for i in range(len(s)):
        if s[i] == "B": 
            if q: q.pop()
        else: q.append(s[i])
    Ans = ""
    while q: Ans += q.popleft()
    print(Ans)
    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    S = input()
    T = []
    for s in S:
        if s == "0" or s == "1":
            T.append(s)
        elif T:
            T.pop()
    print("".join(T))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s= input()

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

Submission status: Accepted

Solution code:
S = input()

ans = []
for s in S:
    if s == '0' or s == '1':
        ans.append(s)
    elif len(s) > 0:
        ans = ans[:-1]

print(''.join(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:
from collections import deque
s=input()
ans=deque()
for i in s:
  if i=='1':
    ans.append('1')
  if i=='0':
    ans.append('0')
  if i=='B':
    ans.pop() if len(ans)>0 else ans
print(''.join(ans))

Submission status: Accepted

Solution code:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    s=str(input())
    ans=[]
    for i in s:
        if i =='0':
            ans.append('0')
        elif i=='1':
            ans.append('1')
        else:
            if ans:
                ans.pop(-1)

    print(''.join(ans))

resolve()

Submission status: Accepted

Solution code:
#B
from collections import deque
l=list(input())
ans=[]
for i in l:
    if i=="B":
        if len(ans)!=0:
            ans.pop()
    else:
        ans+=i
for i in ans:
    print(i,end="")

Submission status: Accepted

Solution code:
string = str(input())

str_len = len(string)

out_string = ""

for num in range(str_len):

    if string[num] == "B":
        if len(out_string) != 0:
            out_string = out_string[:-1]

    else:

        out_string += string[num]


print(out_string)

Submission status: Accepted

Solution code:
string = input()
str_list = list(string)
display_string=""
for char in str_list:
    if char =="B":
        if len(display_string) != 0:
            display_string = display_string[:-1]
    else :
        display_string = display_string + char
print(display_string)

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline

s = readline().rstrip().decode('utf-8')

res = ""

for i in s:
    if i == "0":
        res = res+i
    elif i == "1":
        res = res+i
    else:
        if len(s) != 0:
            res = res[:-1]

print(res)

Submission status: Accepted

Solution code:
from collections import deque
que = deque()
s = input()
n = len(s)
for i in range(n):
    if s[i] == '0':
        que.append('0')
    if s[i] == '1':
        que.append('1')
    if s[i] == 'B':
        if len(que)==0:
            continue
        k = que.pop()
li = list(que)
print(''.join(li))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
def inp(a,s):
  if s=='B':
    if a=='':
      return ''
    else:
      return a[:-1]
  else:
    return a+s

ans = ''
for s in S:
  ans = inp(ans,s)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l=input()
list=list(l)
list_2=[]
length=len(list)
for k in range(length):
  if list[k]=="0":
    list_2.append("0")
  elif list[k]=="1":
    list_2.append("1")
  else:
    if len(list_2)==0:
      continue
    else:
      del list_2[-1]
mojiretsu="".join(list_2)
print(mojiretsu)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
s=input()

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

print("".join(ans))

Submission status: Accepted

Solution code:
s = list(input())
s.reverse()
b = 0
ans = ''

for c in s:
    if c == 'B':
        b += 1
    else:
        if b > 0:
            b -= 1
        else:
            ans += c

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

Submission status: Accepted

Solution code:
s = input()

def genStr(s):
  stuck = []
  for i in s:
    if i == "0" or i == "1":
      stuck.append(i)
    elif i == "B":
      if len(stuck) != 0:
        stuck.pop()
    else:
      return None
    
  return "".join(stuck)

print(genStr(s))

Submission status: Accepted

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

for s in S:
    if s == "B":
        if stack != []:
            # if len(stack) > 0:
            stack.pop()
    else:
        stack.append(s)

print("".join(stack))

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

Submission status: Accepted

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

for s in S:
    if s == "B":
        if len(stack) > 0:
            stack.pop()
    else:
        stack.append(s)

print("".join(stack))

Submission status: Accepted

Solution code:
s=input()
output=""
for n in range(0,len(s)):
    if s[n]=="0":
        output+="0"
    elif s[n]=="1":
        output+="1"
    elif s[n]=="B":
        if len(output)>=1:
            output=output[:len(output)-1]
print(output)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

s = list(input())

t = []

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

print(''.join(t))

Submission status: Accepted

Solution code:
s = list(input())
out = []
for a in s:
  if a == "1":
    out.append("1")
  elif a == "0":
    out.append("0")
  elif a == "B":
    if out == []:
      pass
    else:
      del out[-1]
print("".join(out))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
array=[]
for i in range(len(S)):
    if S[i]=='B':
        if array==[]:
            array=[]
        else:
            array.pop(-1)
    else:
        array.append(S[i])
c=""
for i in range(len(array)):
    c+=array[i]
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
t=""
for x in input():
    if x=="B":
      t=t[:-1]#:-1で右端削除
    else:t+=x
print(t)

Submission status: Accepted

Solution code:
li = list(input())
ans = ""
for i in li:
  if i == "0":
    ans = ans + "0"
  elif i == "1":
    ans = ans + "1"
  elif i == "B":
    ans = ans[:len(ans)-1]
print(ans)

Submission status: Accepted

Solution code:
S=input()
res=[]
for i in range(len(S)):
  if S[i]=="0" :
    res.append("0")
  elif S[i]=="1":
    res.append("1")
  else:
    if len(res)>=1:
      del res[-1]
res="".join(res)
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
out = ""
while len(s) > 0:
  if s[0:1] == '0':
    s = s[1:]
    out += '0'
  if s[0:1] == '1':
    s = s[1:]
    out += '1'
  if s[0:1] == 'B':
    s = s[1:]    
    if len(out) > 0:
      out = out[:-1]
print(out)

Submission status: Accepted

Solution code:
# import bisect
# from collections import Counter, deque
# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
# import itertools
# from operator import attrgetter, itemgetter
# import math

import sys

# import numpy as np

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
    s = input()
    ptr = 0
    l = len(s)
    res = [0] * l

    for i in range(l):
        c = s[i]
        if c == "B":
            ptr = max(0, ptr - 1)
        else:
            res[ptr] = c
            ptr += 1

    print("".join(res[0:ptr]))



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

n = []
for i in s:
    if i == "B":
        if len(n) == 0:
            continue
        else:
            del n[-1]
    else:
        n.append(i)

print(''.join(n))

Submission status: Accepted

Solution code:
s=input()

ans=[]

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

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.pop(-1)
        
print("".join(ans))

Submission status: Accepted

Solution code:
# coding: utf-8

s = input().rstrip()

stk = []

for i in s:
    if i == "B":
        if len(stk) > 0:
            stk.pop()
    else:
        stk.append(i)


print("".join(stk))

Submission status: Accepted

Solution code:
s=input()
lists=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:
            pass
        else:
            del ans[-1]
print("".join(ans))

Submission status: Accepted

Solution code:
S=list(input())

for i in range(10):
    try:
        j=S.index('B')
    except:
        break
    if j!=0:
        del S[j-1:j+1]
    else:
        del S[j]
print(''.join(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7


s = input()
stack = list()
for c in s:
    if c == 'B':
        if len(stack) > 0:
            stack.pop()
    else:
        stack.append(c)
print(''.join(stack))

Submission status: Accepted

Solution code:
import re
input1 = raw_input()

past = input1
s = input1
while True:
    s = re.sub('[0-1]B', '', s)
    if past == s:
        break
    past = s
s = re.sub('^B*', '', s)

print s

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

x=''
for i in s:
    if i=='0' or i=='1':
        x+=str(i)
    elif i=='B':
        x=x[:-1]

print(x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inp=input()
ans=[]
for i in range(len(inp)):
    if inp[i]=='0' or inp[i]=='1':
        ans.append(inp[i])
    else:
        try:
            del ans[-1]
        except:
            pass
            
print("".join(ans))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = []
for i in range(len(S)):
    if S[i]=='B':
        if len(ans)>=1:
            ans.pop()
    else:
        ans.append(S[i])
print(*ans,sep='')

Submission status: Accepted

Solution code:
S=input()
words=[a for a in S]
answers=[]
for n in words:
    if n=='1':
        answers.append('1')
    elif n=='0':
        answers.append('0')
    else:
        if not answers:
            continue
        else:
            answers.pop()
mojiretu=''
for x in answers:
    mojiretu+=x
print(mojiretu)

Submission status: Accepted

Solution code:
s = input()

ans = []
for i in range(len(s)):
  if s[i] == "0":
    ans.append(s[i])
  if s[i] == "1":
    ans.append(s[i])
    
  if s[i] == "B":
    if len(ans) == 0:
      continue
    else:
      del ans[-1]
      
      
print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B
# 2020/03/03 0:12-
s = list(input())

l = []
for i in range(len(s)):
    if s[i] == '0':
        l.append('0')
    elif s[i] == '1':
        l.append('1')
    elif s[i] == 'B':
        if len(l) > 0:
            l.pop()
            
for v in l:
    print(v, end='')

Submission status: Accepted

Solution code:
s = list(input())
editor = []
for n in s:
    if n == "0":
        editor.append("0")
    elif n == "1":
        editor.append("1")
    elif n == "B":
        if editor == []:
            continue
        else:
            editor.pop(-1)
print(*editor, sep="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc043/tasks/abc043_b

s = input()

ans = ''

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

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

Submission status: Accepted

Solution code:
import numpy as np

s = str(input())
ans = np.array([])

for i in s:
    if i == '0':
        ans = np.append(ans,'0')
    elif i =='1':
        ans = np.append(ans,'1')
    elif i == 'B':
        if len(ans) >0:
            ans = ans[:-1]
        else:
            pass

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

ans = ""

while s:
  a = s.pop(0)
  if a == "B" and len(ans) > 0:
    ans = ans[:-1]
  elif a != "B":
    ans += a
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

S = input()

ans = []

for i in S:

    if i == 'B':
        if len(ans) > 0:
            del ans[-1]
    else:
        ans.append(i)

print ("".join(ans))

Submission status: Accepted

Solution code:
import sys, math

def input():
    return sys.stdin.readline()[:-1]

def main():
    S = input()
    ans = ""
    for e in S:
        if e == "B":
            ans = ans[:-1]
        else:
            ans += e
    print(ans)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

result = ""
for c in s:
    if c == "0" or c == "1":
        result += c
    elif c == "B":
        result = result[:-1]
print(result)

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()

result = ''
for c in s:
    if c == '0' or c == '1':
        result += c
    elif c == 'B':
        result = result[:-1]
print(result)

Submission status: Accepted

Solution code:
s = input()

t = ''
for c in s:
  if c == '0':
    t += '0'
  elif c == '1':
    t += '1'
  elif c == 'B':
    t = t[:-1]
print(t)

Submission status: Accepted

Solution code:
def main():
  s = input()
  ans = ''
  for i, sv in enumerate(list(s)):
    if sv == 'B':
      ans = ans[:len(ans)-1]
    else:
      ans += sv
  print(ans)

def input_list():
  return map(int, input().split())

import math
main()

Submission status: Accepted

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

s=input().strip()

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

print(s_new)

Submission status: Accepted

Solution code:
def main():
    operations = input()
    answer = ""
    for operation in operations:
        if operation == "B":
            if not answer == "":
                answer = answer[:-1]
        else:
            answer += operation
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

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

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

print("")