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

Solution (Python):
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))

Solution (Python):
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))

Solution (Python):
res = ''

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

print(res)

Solution (Python):


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

Solution (Python):
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)

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

Solution (Python):
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))

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

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

Solution (Python):
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))

Solution (Python):
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))

Solution (Python):

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)

Solution (Python):

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)

Solution (Python):
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 = "")

Solution (Python):
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()

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

Solution (Python):
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]
 
data = map(str,data)
print(''.join(data))

Solution (Python):
import sys

input = sys.stdin.buffer.readline




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

Solution (Python):
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()

Solution (Python):
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)))

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

Solution (Python):


s=input()

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

Solution (Python):
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()

Solution (Python):
S = input()
ans = []
for s in S:
    if s == "B":
        if ans:
            ans.pop(-1)
    else:
        ans.append(s)
print(*ans, sep='')

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

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

Solution (Python):
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))

Solution (Python):

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

Solution (Python):
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()

Solution (Python):
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)

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

Solution (Python):
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()

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

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

Solution (Python):
s= input()

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

Solution (Python):
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))

Solution (Python):
s = input()

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

Solution (Python):
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))

Solution (Python):








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

Solution (Python):

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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

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

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")
    elif s[i] =="B":
        if len(l) == 0:
           pass
        else:
           del l[-1]
print("".join(l))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):


s=input()

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

print("".join(ans))

Solution (Python):
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))

Solution (Python):
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))

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

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

print("".join(stack))

Solution (Python):
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)

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

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

print("".join(stack))

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):



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

Solution (Python):
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))

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

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

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

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

Solution (Python):
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)

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")
  else:
    if len(res)>=1:
      del res[-1]
res="".join(res)
print(res)

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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):









import sys



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

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

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

Solution (Python):
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))

Solution (Python):
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))

Solution (Python):
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))

Solution (Python):


s = input().rstrip()

stk = []

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


print("".join(stk))

Solution (Python):
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))

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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

Solution (Python):
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)

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

Solution (Python):
s=input()

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

print(x)

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

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

Solution (Python):
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))

Solution (Python):

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

Solution (Python):
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)

Solution (Python):
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='')

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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="")

Solution (Python):


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='')

Solution (Python):
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="")

Solution (Python):
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))

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

Solution (Python):


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)

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

Solution (Python):
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)

Solution (Python):

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)

Solution (Python):
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)

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

Solution (Python):

S = input()

ans = []

for i in S:

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

print ("".join(ans))

Solution (Python):
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()

Solution (Python):
s = input()

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

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

Solution (Python):
s = input()

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

Solution (Python):
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)

Solution (Python):
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()

Solution (Python):


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)

Solution (Python):
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()

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

Solution (Python):
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("")

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

Solution (Python):
from collections import deque
q = deque()

s = input()
for i in range(len(s)):
    if s[i] == "B":
        if len(q) != 0:
            q.pop()
    else:
        q.append(s[i])

print("".join(q))

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

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

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

S = []
for i in s:
    if i == 'B':
        if S != []:
            S.pop(-1)
        else:
            pass
    else:
        S.append(i)
S_s = ''
for i in S:
    S_s += i
    
print(S_s)

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

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

Solution (Python):
keys = input()
r = ""
for k in keys:
  if k == "0":
    r += "0"
  elif k == "1":
    r += "1"
  elif k == "B":
    r = r[:len(r)-1]
print(r)

Solution (Python):
S = input()

d = []
for s in S:
    if s == "0":
        d.append("0")
    elif s == "1":
        d.append("1")
    else:
        if len(d) == 0:
            pass
        else:
            _ = d.pop(-1)

print("".join(d))

Solution (Python):
a = input()

ans = ''

for c in a:
    if c == '0' or c == '1':
        ans += c
    elif 'B':
        ans = ans[0:len(ans)-1]

print(ans)

Solution (Python):
C = []
A = input()
for i in A:
    if i == '0':
        C.append(i)
    if i == '1':
        C.append(i)
    if i == 'B' and  len(C)!=0:
        C.pop()
    else: pass

print("".join(C))

Solution (Python):



s = input()

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

Solution (Python):
s=str(input());ans=[]
for i in range(len(s)):
    if s[i]=="0":
        ans.append(0)
    elif s[i]=="1":
        ans.append(1)
    elif len(ans)!=0:
        del ans[-1]
    else:
        pass
print("".join(map(str,ans)))

Solution (Python):
s = input()
result = ""
for letter in s:
    if letter == "B":
        result = result[:-1]
    elif letter == "1":
        result = result + letter
    elif letter == "0":
        result = result + letter
print(result)

Solution (Python):
s = input()
now = ""

for i in s:
    if i == '0':
        now += '0'
    elif i == '1':
        now += '1'
    else:
        if len(now) == 0:
            continue
        else:
            now = now[:-1]
print(now)

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

for i in s:
    if i == '0':
        now.append(0)
    elif i == '1':
        now.append(1)
    else:
        if len(now) == 0:
            continue
        else:
            now.pop(-1)
for i in now:
    print(i, end="")

Solution (Python):
s = [i for i in input()]
a = []
for i in s:
    if i == "B":
        if a == []: continue
        else: a.pop(-1)
    else: a.append(i)
print("".join(a))

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

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

Solution (Python):
s = input()
l = []
for t in s:
  if t == '0' or t == '1':
    l.append(t)
  elif t == 'B':
    if l != []:
      l.pop()
for r in l:
  print(r, end='')

Solution (Python):
s = list(input())
ans = []
for i in s:
  if i == "0":
    ans.append("0")
  elif i == "1":
    ans.append("1")
  elif ans and i == "B":
    del ans[-1]
print("".join(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 len(s)>0:
      ans=ans[:-1]
print(ans)