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 .

Solution (Python):
import collections

s = list(input())

q = collections.deque()
for i in s:
    if i == "0":
        q.append("0")
    elif i == "1":
        q.append("1")
    else:
        if len(q) > 0:
            q.pop()

print("".join(q))

Solution (Python):
s = input()
out = ''
for c in s:
    if c != 'B':
        out += c
    else:
        out = out[:-1]

print(out)

Solution (Python):
S=input()
T=[]
for i in range(len(S)):
    if S[i]!="B":
        T.append(S[i])
    else:
        if T:
            del T[-1]
print(*T,sep="")

Solution (Python):
s=input()
l=[]
for i in s:
    if i=='0':
        l.append(0)
    elif i=='1':
        l.append(1)
    else:
        if l!=[]:
            l.pop()
for j in l:
    print(j,end='')

Solution (Python):
s=input()
l=[]
for i in range(len(s)):
    if s[i]=='0':
        l.append('0')
    elif s[i]=='1':
        l.append('1')
    else:
        if len(l)>0:
            l.pop(len(l)-1)
x=''.join(l)
print(x)

Solution (Python):
S = input()
while True:
    if '0B' in S or '1B' in S:
        S = S.replace('0B','').replace('1B','')
    else:
        S = S.replace('B','')
        break
print(S)

Solution (Python):
moji = []
ans=""
s = str(input())
s = list(s)

def keyboard(key,list):
    if key == "0":
        list.append("0")
    elif key == "1":
        list.append("1")
    elif key == "B" and len(list) != 0:
        list.pop(-1)

for i in range(len(s)):
    keyboard(s[i],moji)

for x in moji:
    ans += x

print(ans)

Solution (Python):
s = input()

st =''

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

Solution (Python):
s = input()

length = len(s)

ans = ''

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

print(ans)

Solution (Python):
s = str(input())
disp = ""

for i in range(0, len(s)):
  if s[i] == "1":
    disp = disp + "1"
  if s[i] == "0":
    disp = disp + "0"
  if s[i] == "B":
    if len(disp) != 0:
      disp = disp[:-1]
    else:
      disp == ""
print(disp)

Solution (Python):
def typing(s) : 
  t = list()
  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 :
         t.pop()
     
  return t

s = input()
ans = "".join(typing(s))
print(ans)

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

Solution (Python):
s = list(input())

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

print(ans)

Solution (Python):
from collections import deque
s=deque(input())
ans=""
while s:
    t=s.popleft()
    if t=="0":
        ans=ans+"0"
    elif t=="1":
        ans=ans+"1"
    elif t=="B":
        if len(ans)>0:
            ans=ans[:-1]
print(ans)

Solution (Python):
s=list(input())

from collections import deque
ans=deque([])
for p in s:
  if p=="0":
    ans.append("0")
  elif p=="1":
    ans.append("1")
  elif p=="B":
    if ans:
      ans.pop()

print("".join(list(ans)))

Solution (Python):
S=list(str(input()))
d=[]
for i in range(len(S)):
  if S[i]!='B':
    d.append(S[i])
  elif len(d)>0:
    d.pop(-1)
print(''.join(d))

Solution (Python):
S = input()
while 'B' in S:
    S = S.replace('1B', '').replace('0B', '')

    if S[0] == 'B':
        S = S[1:]
print(S)

Solution (Python):
s = input()
t = ''
for i in s:
    if i == '0':
        t = t + '0'
    elif i == '1':
        t = t + '1'
    else:
        if not t == '':
            t = t[:-1]
        else:
            pass
print(t)

Solution (Python):
from collections import deque
s = input()
d = deque()

for i in range(len(s)):
    if (s[i] == 'B' and len(d) != 0):
        d.pop()
    elif(s[i] == 'B' and len(d) == 0):
        continue
    else:
        d.append(s[i])

print(''.join(d))

Solution (Python):
word_list = input()

answer = ""

for i in range(len(word_list)):
    if word_list[i] == "0":
        answer += "0"
    elif word_list[i] == "1":
        answer += "1"
    else:
        answer = answer[0:len(answer)-1]

print(answer)

Solution (Python):
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))



def read_a_int(): return int(read())


def read_ints(): return list(map(int, read().split()))


def read_col(H):
    '''H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) 
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_tuple(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_matrix(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    


MOD = 10**9 + 7
INF = 2**31  

from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  





ans = 'x' * 20

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

Solution (Python):
from collections import deque
s = input()
ans = deque([])

for c in s:
    if c=='0':
        ans.append('0')
    if c=='1':
        ans.append('1')
    if c=='B' and len(ans)!=0:
        del ans[-1]
print(''.join(ans))

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

Solution (Python):
s = input()

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

Solution (Python):



s = input()

display = []

for ch in s:
    if ch == '0' or ch == '1':
        display.append(ch)
    else:
        if len(display) > 0:
            display.pop()

for ch in display:
    print(ch,end='')
print()

Solution (Python):


S = str(input())

w = ""

for i in range(len(S)) :
  if S[i] == "B" :
    if w == "":
      w = ""
    else :
      w = w[:-1]
  else :
    w = w + S[i]
    
print(w)

Solution (Python):
t=[]
for x in input():
    if x=="B":
        try:t.pop()
        except:pass
    else:t.append(x)
print("".join(t))

Solution (Python):
S = input()
A = []
for s in S:
    if s == 'B':
        if len(A) != 0:
            del A[-1]
    else:
        A.append(s)
        
print(''.join(map(str, A)))

Solution (Python):
s=input()
l=list()
for i in str(s):
  if i == "B":
    if len(l) > 0:
      del l[-1]
    else:
      continue
  else:
    l.append(i)
a="".join(l)
print(a)

Solution (Python):
s = list(input())

while "B" in s : 
    b = s.index('B') 
    if b != 0: 
        del s[b-1:b+1] 
    elif b == 0: 
        del s[b]

s = ''.join(s) 
print(s)

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

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

for x in s:
    if x != "B":
        ans.append(x)
    else:
        if ans != []:
            ans.pop()

print(*ans, sep = "")

Solution (Python):
s=input()
n=len(s)
a=[]
b=""
for i in range(n):
  if s[i]=="B":
    if len(a)!=0:
      a.pop()
  else:
    a.append(s[i])
for i in range(len(a)):
  b+=a[i]
print(b)

Solution (Python):
S=input()

result = []
for c in list(S):
   if c == 'B' and len(result)>0:
     result.pop(-1)
   elif c== 'B':
     result = []
   else :
     result.append(c)

print("".join(result))

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

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

Solution (Python):
S = input()

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

Solution (Python):
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction



mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]







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

Solution (Python):
s = list(input())
lis = []

for i in s:
  if i == 'B':
    if len(lis) != 0:
      lis.pop()
  elif i == '0':
    lis.append('0')
  elif i == '1':
    lis.append('1')
    
print(''.join(lis))

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

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

Solution (Python):
s = input()
b = 0
ans = ''
for c in s[::-1]:
	if c == 'B':
		b += 1
	elif not b:
		ans += c
	else:
		b -= 1
print(ans[::-1])

Solution (Python):
S = input()
text = ""

for s in S:
    if s == "0":
        text += "0"
    elif s == "1":
        text += "1"
    elif text and s == "B":
        text = text[:-1]
print(text)

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

Solution (Python):


S = input()

ans = []
for i,j in enumerate(S):
  if (len(ans) != 0) and (j == 'B'):
    ans.pop(-1)
  elif (j == 'B'):
    pass
  else:
    ans.append(j)

print(''.join(ans))

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

Solution (Python):
def main():
    S = list(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))

if __name__ == "__main__":
    main()

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

Solution (Python):
l = []
for c in input():
    if c == "B":
        try:
            l.pop()
        except:
            pass
    else:
        l.append(c)
print("".join(l))

Solution (Python):
S = input()
ans = []
for s in S:
  if s=="B":
    if len(ans)==0: continue
    else: ans.pop()
  else:
    ans.append(int(s))

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

Solution (Python):
from collections import deque
s=input()
Q=deque()
for i in range(len(s)):
    if s[i]=="0":
        Q.append("0")
    elif s[i]=="1":
        Q.append("1")
    else:
        if len(Q)==0:
            pass
        else:
            Q.pop()
ans="".join(list(Q))
print(ans)

Solution (Python):
li = list(input())
line = []

for i in li:
  if i == "0":
    line.append("0")
  elif i == "1":
    line.append("1")
  else:
    if len(line) != 0:
      line.pop(len(line) - 1)

print("".join(line))

Solution (Python):
s = input()
o = []
for i in s:
    if i=='B':
        if o: o.pop()
    else:
        o.append(i)
print(*o, sep='')

Solution (Python):
s = input()
string = []
for i in range(len(s)):
    if s[i] == '0':
        string.append(str(s[i]))
    elif s[i] == '1':
        string.append(str(s[i]))
    else:
        if len(string) == 0:
            continue
        else:
            string.pop(-1)
print("".join(string))

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

Solution (Python):
s = input()
l = []

for i in s:
    if i != "B":
        l.append(i)
    else:
        if l != []:
            del l[-1]

print("".join(l))

Solution (Python):
s = input()
ans_list = []

for i in range(len(s)):
  if(s[i] != 'B'):
    ans_list.append(s[i])
  elif(s[i] == 'B' and len(ans_list) != 0):
    ans_list.pop()
    
ans_str = ''.join(ans_list)

print(ans_str)

Solution (Python):
s = input()

new = ""
for i in s:
	if i == "0":
		new += i
	elif i == "1":
		new += i 
	elif i == "B":
		new = new[:-1]	
		
	elif i == " ":
		pass	
print("".join(new))

Solution (Python):
S = input()
stack = []
for ss in S:
    if ss == '0':
        stack.append(ss)
    elif ss == '1':
        stack.append(ss)
    elif ss == 'B':
        if len(stack):
            stack.pop()

print(''.join(stack))

Solution (Python):
S = list(input())
result = []
for s in S:
    if s != "B":
        result.append(s)
    elif len(result) == 0:
        continue
    else:
        result.pop()

print("".join(result))

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



if __name__ == "__main__":
    main()

Solution (Python):
s = input()

ans = []

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

Solution (Python):
s = input()

l = list()

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

print(''.join(l))

Solution (Python):
s = input()
s_list = []
input_list = []

for i in range(len(s)):
    s_list.append(s[i])

for i2 in range(len(s)):
    if s_list[i2] == "0":
        input_list.append("0")
    elif s_list[i2] == "1":
        input_list.append("1")
    elif input_list == []:
      pass
    else:
      input_list.pop(-1)
      

for i3 in range(len(input_list)):
    print(input_list[i3],end="")

Solution (Python):
s = input()

ans = ''
for c in s:
    if c == '0':
        ans += '0'
    if c == '1':
        ans += '1'
    if c == 'B':
        ans = ans[:-1]

print(ans)

Solution (Python):
S = list(str(input()))
ans = []
for i, s in enumerate(S):
    if s == 'B':
        if ans:
            ans.pop()
        else:
            continue
    else:
        ans.append(s)

print(''.join(ans))

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

Solution (Python):
a=input()
a1=list(a)
c=""
j=0
list1=[]



for i in a1:
    if i=="0":
        list1.append("0")
        j=j+1
    elif i=="1":
        list1.append("1")
        j=j+1
    elif i!="0" and i!="1" and j>=1:
        list1.pop()
        j=j-1
for j in range(len(list1)):
    c=c+list1[j]
print(c)

Solution (Python):
N = input()

ind = ""

for i in N:
  if i == "B":
    if ind != "":
      ind = ind[0:-1]
  else:
    ind += str(i)
print(ind)

Solution (Python):
S = input()
ans = ''
for s in S:
    if s == '0':
        ans += '0'
    elif s == '1':
        ans += '1'
    elif s == 'B' and ans != '':
        ans = ans[:-1]
print(ans)

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

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

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

Solution (Python):
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()

s = input()
data = []
for x in s:
    if x == "B":
        try:data.pop()
        except:pass
    else:
        data.append(x)
print(*data,sep="")

Solution (Python):
def main():
    import sys
    
    s = sys.stdin.readline().strip()
    
    output = ""
    for i in range(len(s)):
        if s[i] == "B":
            output = output[:len(output)-1]
        else:
            output += s[i]
            
    print(output)
        
if __name__ == "__main__":
    main()

Solution (Python):

import sys

import fractions
import copy
import bisect
import math
import numpy as np
import itertools
from itertools import combinations_with_replacement


from operator import itemgetter
from sys import stdin

from operator import mul
from functools import reduce
from collections import Counter





j=0
k=0
n=3
r=1
a=[0]






"1行1つの整数を入力を取得し、整数と取得する"




"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

for i in number_list:
    print(number_list[i-1])

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''



"正方行列にstr型の値を入力"
'''




'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"


'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''











'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''




"aという変数に入っているものを大文字にして出力"

















'''
コンビネーションの組み合わせの中身を出力する形式
for i in itertools.combinations(brray, 2)
combinationsをpermutationsにすれば順列になる
今回なら(abc133B)
入力
1 2
5 5
-2 8
出力
[[1, 2], [5, 5], [-2, 8]]
もちろん一次元リストでも使えるし
何よりiもリストのように使えるので便利
'''


'''
def cmb(n,r):
    
    r= min(n-r,r)
    
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    
    
    

    under = reduce(mul, range(1, r+1))
    
    
    
    

    return over // under
    
    
    
    
a = cmb(n, r)

'''

'''
import itertools
from itertools import combinations_with_replacement

combinationについて
以下の違いを意識しよう
combinations() p, r 長さrのタプル列、ソートされた順で重複なし

combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり


使用例 　　　　　　　　　　　                  出力　　
combinations('ABCD', 2)　　　　　　　　　　　　AB AC AD BC BD CD

combinations_with_replacement('ABCD', 2)　　 AA AB AC AD BB BC BD CC CD DD
'''



'''




for i in a.most_common(n):print(i)





 


'''









'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''

'''
素数の判定
'''


def is_prime(n):
    if n == 1: return False

    for k in range(2, int(np.sqrt(n)) + 1):
        
        if n % k == 0:
            return False
            
    return True


'''
npのmaxとmaximumの違い
xs = np.array([1, -2, 3])
np.max(xs, 0)
この出力は3となります．[1, -2, 3]と0の4つの数字のうち，最も大きい値を出力します．

一方で，[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります．
その時は，numpyのmaximum関数を用います．

xs = np.array([1, -2, 3])
np.maximum(xs, 0)  

'''

def factorial(x, mod=10**9+7):
    
    
    
    tmp = 1
    for i in range(1, x+1):
        tmp = (tmp * i) % mod
    return tmp
    '''
    Basically, when you do a**d % n, you actually have to calculate a**d, which could be quite large.
    But there are ways of computing a**d % n without having to compute a**d itself, and that is what pow does.
    '''











'''
ascii_letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
digits = '0123456789'
hexdigits = '0123456789abcdefABCDEF'
letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv...\xaf\xb0...
lowercase = 'abcdefghijklmnopqrstuvwxyz'
octdigits = '01234567'
printable = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU...
punctuation = '!"
uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
whitespace = '\t\n\x0b\x0c\r '
'''
'''
引数endに任意の文字列を指定すると、その文字列が改行の代わりに最後に挿入される。例えば連続するprint()の出力を改行なしで単純に連結したい場合は空文字列''を指定すればよい。

print('abc', end='---')
print('xyz')


print('abc', end='')
print('xyz')

source: print_basic.py
なお、デフォルトで改行されるのは引数endのデフォルト値が改行文字'\n'に設定されているから。
'''

def main():
    n=3
    steps=0
    state=0
    w=1
    j=0
    k=0
    
    
    
    
    
    s=input()
    a=[i for i in s]
    n=len(s)
    c=[]
    for i in range(n):
        if a[i]=="0":
           c.append("0")
        elif a[i]=="1":
           c.append("1")
        elif a[i]==("B") and c!=[]:
           del c[-1]
    
    
    
    print("".join(c))
    
    
    
    


    
    
     

    l = ['aaa', 'bbb', 'ccc']
    x=l.index('aaa')
    
    
    
    

    
        
    
    

    
    
    
    
    DP = np.zeros(w+1, dtype=int)
    exdp=np.zeros((3,4)) 
    
    
    
        
        
    
    
        
        
    


    
    



    '''
    入力
    1234
    出力
    [1, 2, 3, 4]
    '''
    pin_l=["x" for i in range(10)]
    

    ls = ["a", "b", "c", "d", "e"]


    
    

    
    

    
    
    
    
    
    '''
    lsというリストの場合に、1つ飛びの値を取得したい場合には
    ls[::2]
    のようにします。こうすると、
    ["a", "c", "d"]と出力される
    '''

if __name__ == "__main__":
    main()

Solution (Python):
a=list(input())
b=[]

for i in a:
    if i=="0":
        b.append(i)
    if i=="1":
        b.append(i)
    if i=="B":
        if b!=[]:
            b.pop(-1)
for j in b:
    print(j,end="")

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

for s in S:
  if s == '0':
    stack.append(0)
  elif s == '1':
    stack.append(1)
  elif s == 'B':
    if stack:
      stack.pop()

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

Solution (Python):
import re
key=re.compile('[01]B')

s=input()
result=key.search(s)

while result!=None:
    s=s[0:result.start()]+s[result.end():]
    result=key.search(s)
    
while s[0]=='B':
    s=s[1:]

print(s)

Solution (Python):
s=list(input())

answer=[]
for c in s:
  if c=="B":
    if answer:
      answer.pop()
  else:
    answer.append(c)


print("".join(answer))

Solution (Python):
from collections import deque
ss = input()
q = deque()
for s in ss:
    if s == "B" and len(q) > 0:
        q.pop()
    elif s == "B" and len(q) == 0:
        continue
    else:
        q.append(s)
print(''.join(q))

Solution (Python):
s=input()
l=len(s)
a=[]
for i in range(l):
  n=len(a)
  if s[i]=='0':
    a.append(0)
  elif s[i]=='1':
    a.append(1)
  elif s[i]=='B':
    if a!=[]:
      del a[n-1]
    
for i in range(len(a)):
  print(a[i],end="")

Solution (Python):
S = str(input())

ans = ''

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

print(ans)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    s=input()
    l=[]
    for i in s:
        if i=='0' or i=='1':
            l.append(i)
        else:
            if len(l)>=1:
                l.pop(-1)
    print(''.join(l))
resolve()

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    s=input()
    l=[]
    for i in s:
        if i=='0':
            l.append('0')
        elif i=='1':
            l.append('1')
        else:
            if len(l)>=1:
                l.pop(-1)
    ans=''
    for j in l:
        ans+=j
    print(ans)
resolve()

Solution (Python):
def ABC_43_B():
    s = 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:
                a=0
            else:
                del t[len(t)-1]

    print(''.join(t))



if __name__ == '__main__':

    ABC_43_B()

Solution (Python):
import sys
def S(): return sys.stdin.readline().rstrip()
s = S()
ans = ''
for x in s:
    if x in '01':
        ans += x
    else:
        if ans:
            ans = ans[:-1]
print(ans)

Solution (Python):
S = input()

ans = ''
for ch in S:
  if ch in ('0', '1'):
    ans += ch
  elif ch == 'B' and ans:
    ans = ans[:-1]

print(ans)

Solution (Python):
S = input()
L = []
for i in S:
    if i == "0":
        L.append("0")
    elif i == "1":
        L.append("1")
    else:
        if L:
            L.pop()
print("".join(L))

Solution (Python):
A = input()
output = []
for a in range(len(A)):
    if A[a]=="B":
        if not output==[]:
            output.pop()
    else:
        output.append(A[a])
print(*output,sep='')

Solution (Python):
import sys
input = sys.stdin.readline
from collections import deque
def main():
    S = list(input().rstrip())
    ans = deque()
    for c in S:
        if c == "B":
            if len(ans) == 0:
                continue
            else:
                ans.pop()
        elif c == "0":
            ans.append(c)
        else :
            ans.append(c)
    print("".join(ans))

if __name__ == '__main__':
    main()

Solution (Python):
s = input()
moji = []
for i in s:
    if i == "0":
        moji.append("0")
    elif i == "1":
        moji.append("1")
    else:
        if len(moji) != 0:

            moji.pop(len(moji)-1)
print("".join(moji))

Solution (Python):

def get_input() -> str:
    """
    標準入力の取得.

    Returns:\n
        str: 標準入力
    """
    s = input()
    return s


def main(s: str) -> None:
    """
    求解処理.\n
    順番に処理を行う.

    Args:\n
        s (str): しぐが押したキーを順番に記録した文字列
    """
    result = str()
    for s_i in s:
        if s_i == "0":
            result += "0"
        elif s_i == "1":
            result += "1"
        elif s_i == "B":
            result = result[:-1]

    
    print(result)


if __name__ == "__main__":
    s = get_input()
    main(s)

Solution (Python):


s = input()


result = str()
for s_i in s:
    if s_i == "0":
        result += "0"
    elif s_i == "1":
        result += "1"
    elif s_i == "B":
        result = result[:-1]


print(result)

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

Solution (Python):
s = input()

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

Solution (Python):
S = input()

x = ""
for s in S:
  if x=="" and s=="B":
    continue
  if s=="B":
    x = x[:-1]
  else:
    x += s
    
print(x)

Solution (Python):
import collections


def inputStrOnebyOne():
    s = list(input())
    return s


def inputOnebyOne_Int():
    a = list(int(x) for x in input().split())
    return a

def main():
    s = inputStrOnebyOne()
    ret = []
    for i in range(len(s)):
        if s[i] == "0":
            ret.append(s[i])
        elif s[i] == "1":
            ret.append(s[i])
        else:
            if 1<=len(ret):
                ret.pop()
    print(''.join(ret))

if __name__=='__main__':
    main()

Solution (Python):
S = input()

ret = ""
for i in S:
    if i == "B":
        ret = ret[:-1]
    else:
        ret += i

print(ret)

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

Solution (Python):
s = input()

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

print(ans)

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    S=input()
    ans=[]
    for s in S:
        if s=='B':
            if ans:
                ans.pop()
        else:
            ans.append(s)
    print(''.join(ans))

if __name__ == '__main__':
    main()

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

Solution (Python):
s = str(input())
ans = ''
for i in s:
    if i == '0':
        ans += '0'
    elif i == '1':
        ans += '1'
    elif i == 'B' and len(ans) >= 1:
        ans = ans[:-1]
    else:
        continue
print(ans)

Solution (Python):
S=input()
res = []
for s in S:
    if s=='0':
        res.append('0')
    elif s=='1':
        res.append('1')
    else:
        if res:
            res = res[:-1]
print(''.join(res))

Solution (Python):
s = input()
res = []

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

print("".join(res))