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

s = input()

ans = ""
for a in s:
    if a == "0":
        ans+="0"
    elif a == "1":
        ans+="1"
    else:
        ans = ans[:-1]
print(ans)

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

for i in range(len(a)):
  if a[i] == "0":
    b.append("0")
  elif a[i] == "1":
    b.append("1")
  elif a[i] == "B":
    if b == []:
      b = []
    else:
      del b[-1]
    
print("".join(b))

Solution (Python):
s = input()
A = []
moji = ''
for i in range(len(s)):
  if s[i]=='B':
    A = A[:-1]
  else:
    A.append(s[i])
moji = ''.join(A)
print(moji)

Solution (Python):
ans = []
for s in list(input()):
    if s == '0' or s == '1':
        ans.append(s)
    elif s == 'B':
        if not ans:
            continue
        ans.pop()
print(''.join(ans))

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

for c in s:
  if c == 'B':
    if m:
      m.pop()
  else:
    m.append(c)

print(''.join(m))

Solution (Python):
s = input()
STR = []
for i in s:
    if i != 'B':
        STR.append(i)
    elif STR.__len__() == 0:
        continue
    else:
        STR.pop()

print("".join(STR))

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

Solution (Python):


s=input()

r=''

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

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

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

Solution (Python):
s=list(input())
out=[]
for i in range(len(s)):
    if s[i]=="B" and out==[]:
        out=[]
    elif s[i]=="B":
        del(out[-1])
    else:
        out.append(s[i])
for i in range(len(out)):
    print(out[i],end="")

Solution (Python):


s = list(input())
line = []
for w in s:
    if w == '0':
        line.append(w)
    elif w == '1':
        line.append(w)
    elif w == 'B' and line:
        line.pop()

for n in line:
    print('{0}'.format(n), end='')

Solution (Python):
sS = input().rstrip()
a = []
for s in sS:
    if s == "B":
        if 0 < len(a):
            
            a = a[:-1]
    else:
        a.append(s)
print("".join(a))

Solution (Python):

sS = input().rstrip()
a = []
for s in sS:
    if s == "B":
        if 0 < len(a):
            del a[-1]
    else:
        a.append(s)
print("".join(a))

Solution (Python):
a=list(input())
b=[]
for i in a:
    if (i=="0") or (i=="1"):
        b.append(i)
    elif b!=[] :
        b.pop(-1)
print("".join(b))

Solution (Python):
def main():
    s = input()
    ans = ''
    for ch in s:
        if ch == 'B' and len(ans) != 0:
            ans = ans[:-1]
        elif ch == 'B' and len(ans) == 0:
            ans = ''
        else:
            ans += ch

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from sys import stdin


def main():
    s = next_str()
    ans = []

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

    print("".join(ans))


def next_str():
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Solution (Python):
li = list(input())
string = ''
for item in li:
        if item == '0':
                string += '0'
        elif item == '1':
                string += '1'
        else:
                string = string[:-1]

print(string)

Solution (Python):
res = []
s = input()
for c in s:
    if c=='B':
        if len(res)!=0:
            res = res[:-1]
    else:
        res.append(c)
print(''.join(res))

Solution (Python):
S = input()

S_list = list(S)

answer = []
for S_num in S_list:
    if S_num == '0':
        answer.append('0')
    elif S_num == '1':
        answer.append('1')
    elif not answer:
        continue
    else:
        del answer[-1]

answer_honmono = ''
answer_honmono = ''.join(answer)
print(answer_honmono)

Solution (Python):
l = [x for x in input()]
s = []
for x in l:
    if x == "0":
        s.append("0")
        
    elif x == "1":
        s.append("1")
    
    elif x == "B":
        try:
            del s[-1]
        except IndexError:
            pass
print("".join(s))

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

Solution (Python):
ar = list(input())
br = []
for a in ar:
  if a == "0" or a == "1":
    br.append(a)
  else:
    if len(br) != 0:
    	del br[len(br)-1]
print("".join(br))

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


if __name__ == "__main__":
    main()

Solution (Python):


"""
    1. 先頭のB全部を消す
    2.
"""
import re

test_mode = False
s = str(input())

for _ in range(10):
    while s[0] == 'B':
        s = s[1:]
        if test_mode is True:
            print(s)
    s = re.sub('0B|1B', '', s)
    if 'B' not in s:
        print(s)
        break


"""
参考
    Pythonで文字列の最初・最後の１文字（数文字）を削除する
    https://robotics4society.com/2017/06/29/python_mojisakujo/
"""

Solution (Python):

from sys import stdin

s = stdin.readline().rstrip()
ans = ""

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

print(ans)

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

Solution (Python):
S = input()
ans = ''
for c in S:
    if c == '0' or c == '1':
        ans += c
    else:
        if ans == '': continue
        ans = ans[:-1]
print(ans)

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

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

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

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

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def main():
    S = input()
    ans = []
    for c in S:
        if c == "0":
            ans.append("0")
        elif c == "1":
            ans.append("1")
        else:
            if ans:
                ans.pop()

    print("".join(ans))

if __name__ == '__main__':
    main()

Solution (Python):
s = input()
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 ans != []:
            ans.pop()

print("".join(ans))

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

for i in s:
  if i == "0" or i == "1" :
    a += [i]
  elif a != []:
    del a[-1]

print("".join(a))

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

print(t)

Solution (Python):
s=input();c=0;t='';
for i in range(len(s)-1,-1,-1):
    if s[i]=='B':c+=1
    else:
        if c>0:c-=1
        else:t=s[i]+t
print(t)

Solution (Python):
s = input()

a = []
ans = ""

for i in range(len(s)):
    if s[i] == '0':
        a.append('0')

    elif s[i] == '1':
        a.append('1')

    else:
        if len(a) != 0:
            a.pop()



ans = "".join(a)

print(ans)

Solution (Python):
s = str(input())
list = list(s)
count = 0
ans = ""
while count < len(list):
  if list[count] == "B":
    ans = ans[:-1]
  else:
    ans += list[count]
  count += 1
print(ans)

Solution (Python):
s = input()
a = ''

for _ in s:
    if _ == 'B':
        a = a[:-1]
    else:
        a += _

print(a)

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

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

Solution (Python):
S = input()

ans = []
for ch in S:
  if ch != "B":
    ans.append(ch)
  elif len(ans) > 0:
    ans.pop()
    
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):
S = input()

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

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

Solution (Python):
s=input()
a=[]
for i in range(len(s)):
    if s[i]=='0':
        a.append('0')
    elif s[i]=='1':
        a.append('1')
    else:
        if len(a)!=0:
            trash=a.pop()
        else:
            pass
print(''.join(a))

Solution (Python):



s = input()

t = []
for si in s:
    if si != 'B':
        t.append(si)
    elif t != []:
        t.pop()

print(''.join(t))

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):
      del L[len(L)-1]
print((''.join(L)))

Solution (Python):
s = list(input())
S = []
for i in s:
    if i == "0":
        S.append(0)
    elif i == "1":
        S.append(1)
    elif i == "B":
        if len(S) != 0:
            del S[-1]

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

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

while 'B' in s:
    if s[0] == 'B':
        s=s[1:]
    s=s.replace('0B','')
    s=s.replace('1B','')

print(s)

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

Solution (Python):
def convert_input(input_str):
    result = ''

    for s in input_str:
        if s == 'B':
            result = result[:-1]
        else:
            result += s
    
    return result

if __name__ == '__main__':
    s = input()
    print (convert_input(s))

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()
text = ''
for i in S:
    if i == 'B':
        text = text[:-1]
    else:
        text += i
print(text)

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

Solution (Python):
s = input()
text = ''
for letters in s:
  if letters == 'B':
    if text == '':
      pass
    else:
      text = text[0:-1]
  else:
    text += letters
print(text)

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

Solution (Python):
s = (input())
ans = []
for i in s:
    if i == '0':
        ans.append(0)
    elif i == '1':
        ans.append(1)
    elif i == 'B':
        if len(ans) >= 1:
            del ans[-1]
ans = list(map(str, ans))
print(''.join(ans))

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

Solution (Python):
s = input()
out = ''

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

print(out)

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

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

Solution (Python):
s = input()

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):
ans = ""
s = input()

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

Solution (Python):
s=input()

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

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

Solution (Python):


def main():
    s = list(input())
    ans = []
    for i in s:
        if i == '0':
            ans.append('0')
        elif i == '1':
            ans.append('1')
        elif i == 'B':
            if len(ans) == 0:
                ans = []
            else:
                ans.pop()
    print(''.join(ans))

if __name__ == '__main__':
    main()

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

Solution (Python):
text = input()
lis = []
for i in range(len(text)):
    if text[i] == "B" and len(lis) != 0:lis.pop()
    elif text[i] != "B":lis.append(text[i])
print("".join(lis))

Solution (Python):
s = list(input())
a = []
for i in s:
  if i == "0":
    a.append("0")
  elif i == "1":
    a.append("1")
  else:
    a = a[:-1]
print("".join(a))

Solution (Python):

s = list(input())
a =''

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

Solution (Python):
str = input()
output = ""
for n in str:
    if(n=="0"):
        output+="0"
    elif(n=="1"):
        output+="1"
    elif(n=="B"):
        output = output[:-1]
print(output)

Solution (Python):

def main():
    s = list(input())

    while "B" in s:
        b = s.index("B")
        if b != 0:
            s.pop(b-1)
            s.pop(b-1)
        else:
            s.pop(b)

    print("".join(s))


if __name__ == "__main__":
        main()

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

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

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

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

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

Solution (Python):
S = input()

ans = []
for s in S:
    if s in ['0', '1']:
        ans.append(s)
    elif len(ans) > 0:
        ans.pop()
print(''.join(ans))

Solution (Python):
import sys

s= list(input())

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

print("".join(ans))

sys.exit(0)

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

Solution (Python):
S = input()

ans = []
for s in S:
    if s in ['0', '1']:
        ans.append(s)
    elif len(ans) > 0:
        ans.pop()
print(''.join(ans))

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

Solution (Python):
s = input()
list = []
for i in s:
    if i == 'B':
        if list !=[]:            
            list.pop(-1)
    else:
        list.append(i)
for i in list:
    print(i, end="")

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

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

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

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

ans = []
l = -1

for i in S:
    if i == '0':
        ans.append(i)
        l+=1
    elif i == '1':
        ans.append(i)
        l+=1
    else:
        if l>=0:
            del ans[l]
            l-=1
            
print(''.join(ans))

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

Solution (Python):
s = input()

text = ""
for s_i in s:
	if s_i == "B":
		text = text[:-1]
	else:
		text += s_i
print(text)

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

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 = input()
r = ''
for i in range(len(S)):
    if S[i] == 'B':
        if len(r) != 0:
            r = r[:-1]
    else:
        r += S[i]
print(r)

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):
k=input()
a=[]
for i in k:
    if i=="B":
        if len(a)>0:
            del a[-1]
    else:
        a.append(i)
s=""
for i in a:
    s+=i
print(s)

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

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

Solution (Python):
s = raw_input()
res = ''
for t in s:
  if t == '0' or t == '1':
    res += t
  else:
    if res:
      res = res[:-1]
print(res)

Solution (Python):
output = []

def key(c):
    global output
    if c == '0':
        output.append('0')
    elif c == '1':
        output.append('1')
    else:
        output = output[:-1]


s = input()
for c in s:
    key(c)


print(''.join(output))

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

print(ans)

Solution (Python):
S = input()

r = []
for i in range(len(S)):
    if S[i] == '0':
        r.append('0')
    elif S[i] == '1':
        r.append('1')
    elif S[i] == 'B':
        if len(r) > 0:
            r.pop(-1)

str_r = ""
for _r in r:
    str_r += _r

print(str_r)

Solution (Python):
s = list(input())
x = len(s)
seq = ""
for i in range(x):
	if s[i] == "0":
		seq += "0"
	elif s[i] == "1":
		seq += "1"
	else:
		if seq == "":
			pass
		else:
			seq = seq[0:-1]

print(seq)

Solution (Python):
N=list(input())
t=[]
for i in N:
    if i=="0":
        t.append("0")
    elif i=="1":
        t.append("1")
    else:
        if t!=[]:
            t.pop(-1)
print("".join(t))

Solution (Python):


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

Solution (Python):


s = input()

def typeStr(ans, str1):
    if str1 == "B":
        
        if ans != "":
            
            ans = ans[0:-1]
    else:
        ans += str1
    return ans

ans = ""
for i in range(len(s)):
    ans = typeStr(ans, s[i])

print(ans)

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

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":
        
        if ans != "":
            
            ans = ans[0:-1]

print(ans)

Solution (Python):


s = input()

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 ans:
            
            del ans[-1]

print("".join(ans))

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

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

Solution (Python):
s=input()
while'B'in s:
    s=s[s[0]=='B':].replace('0B','').replace('1B','')
print(s)

Solution (Python):
import re
s = input()
for _ in range(s.count('B')):
    s = re.sub('.?B', '', s, 1)
print(s)

Solution (Python):
import re
s = input()
for _ in range(s.count('B')):
    s = re.sub('(^|[01])B', '', s)
print(s)

Solution (Python):
import re
s = input()
for _ in range(s.count('B')):
    s = re.sub(r'(^|[01])B', '', s)
print(s)

Solution (Python):
s=input()
while'B'in s:
    s=s.replace('0B','').replace('1B','')
    if s[0]=='B':s=s[1:]
print(s)

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

output_string = []

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

print("".join(output_string))

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

Solution (Python):
s=raw_input()
buf = []
for c in s:
  if c == '0':
    buf.append('0')
  elif c == '1':
    buf.append('1')
  elif c == 'B':
    if len(buf) > 0:
      buf = buf[:-1]
print ''.join(buf)

Solution (Python):
S = input()[::-1]
res = ""

ruiseki = 0
for s in S:
    if s == 'B':
        ruiseki += 1
    else:
        if ruiseki > 0:
            ruiseki -= 1
        else:
            res += s
print(res[::-1])

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

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

Solution (Python):
s =list(input())
a = []
for i in range(len(s)):
    if s[i] == 'B':
        if a == []:
            pass
        else:
            del a[-1]
    else :
        a += s[i]

print(''.join(a))

Solution (Python):
s = input()
r = []
for i in s:
    if i == 'B' and r:
        r.pop()
    if i != 'B':
        r.append(i)
print(''.join(r))

Solution (Python):
s = input()
data =[]
for i in range(len(s)):
  data.append(s[i])
array = []
for i in range(len(data)):
  if data[i] == "0":
    array.append("0")
  elif data[i] == "1":
    array.append("1")
  elif (len(array) != 0 and data[i]== "B"):
    array.pop(-1)
  else:
    pass

mojiretu = ''

for x in array:
    mojiretu += x

print(mojiretu)

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

Solution (Python):
S = input()


ans = []

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

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


print()

Solution (Python):
s = input()

final = ""
length = len(s)
for i in range(length):
    if s[i] == "0":
        final = final + "0"
    elif s[i] == "1":
        final = final + "1"
    else:
        if len(final)!=0:
            last = len(final)
            final = final[0:last-1]
print(final)

Solution (Python):
s = input()

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

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

Solution (Python):
if __name__ == '__main__':
    s = input()
    result = []
    for c in s:
        if c == '0' or c == '1':
            result.append(c)
        elif c == 'B' and len(result) > 0:
            result.pop()
    print("".join(result))

Solution (Python):
a=list(input())
x=[]
for ai in a:
  if x !=[] and ai=="B":
    x.pop()
  elif ai in ["0","1"]:
    x.append(ai)
print("".join(x))

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

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

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

print(t)

Solution (Python):
def main():
    s = input()
    d = ""
    
    for i in s:
        if i == "0":
            d += "0"
        elif i == "1":
            d += "1"
        else:
            d = d[:-1]
            
    print(d)
    
    
if __name__ == "__main__":
    main()

Solution (Python):
s = input()
s = list(s)
ans = []
for i in s:
    if i == "0" or i == "1":
        ans.append(i)
    else:
        try:
            del ans[-1]
        except:
            continue

    
print("".join(ans))

Solution (Python):

ANS = []

for ch in list(input()):
    if ch == '0':
        ANS.append(ch)
    elif ch =='1':
        ANS.append(ch)
    else:
        if ANS:
            ANS.pop()

print(''.join(ANS))

Solution (Python):
S = input()
Ans_list = []
Ans = ''
for i in S:
	if i != 'B':
		Ans_list.append(i)
	elif i == 'B' and Ans_list != []:
		Ans_list.pop()
for i in Ans_list:
	Ans += i
print(Ans)

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

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

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

Solution (Python):
import re
s = input()
for i in range(s.count('B')):
    s = re.sub(r'^B', '', s)
    s = re.sub(r'(0|1)B', '', s)
print(s)

Solution (Python):
in1 = input()
r = ""
for c in in1:
  if c == "0":
    r+="0"
  elif c == "1":
    r+="1"
  else:
    r = r[:-1]
print(r)

Solution (Python):
sl = input()

output = []
for s in sl:
    if s == "B":
        output = output[:-1]
    elif s == "0":
        output.append("0")
    elif s == "1":
        output.append("1")
        
print("".join(output))

Solution (Python):
import math
import sys

def getinputdata():

    
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

strdata=""
s = arr_data[0][0]


for v in s:
    
    if v=="0":
        
        strdata+="0"
        
    elif v=="1":

        strdata+="1"
    
    else:
        
        strdata=strdata[0:len(strdata)-1]

print(strdata)

Solution (Python):
s = raw_input()
ans = ""

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

print ans

Solution (Python):
s = input()
n=len(s)
ans=""
for c in s:
    if c=="0":
        ans += "0"
    elif c=="1":
        ans +="1"
    elif c=="B":
         ans= ans[:-1]

print(ans)

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

Solution (Python):





if __name__ == '__main__':
    s = input()
    result = ''

    for si in s:
        if si == '0' or si == '1':
            result += si
        elif si == 'B':
            if len(result) != 0:
                result = result[:len(result) - 1]

    print(result)

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

print(b)

Solution (Python):
s_list = list(input())
ans_list = []

for s in s_list:
    if s == "1" or s == "0":
        ans_list.append(s)
    elif ans_list != []:
        ans_list.pop()
        
print("".join(ans_list))

Solution (Python):
S = input()
T = ""
for w in S:
    if w == "B" and T != "":
        T=T[:-1]
    elif w != "B":
        T += w
print(T)