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=list(input())
ans=str()
for i in S:
  if i=="0":
    ans+="0"
  elif i=="1":
    ans+="1"
  else:
    if ans!="":
      ans=ans[:-1]
print(ans)

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

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

print(ans)

Solution (Python):
x = input()
li = []
sz = 0
for i in x:
    if (i == '0') or (i == '1'):
        li.append(i)
        sz += 1
    else:
        if sz > 0:
            li.pop()
            sz -= 1

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

Solution (Python):
x = input()
li = []
sz = 0
for i in x:
    if (i == '0') or (i == '1'):
        li.append(i)
        sz += 1
    else:
        if sz > 0:
            li.pop()
            sz -= 1

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

Solution (Python):
S = input()
stack = []
for c in S:
    if c == '0' or c == '1':
        stack.append(c)
    elif len(stack) > 0:
        stack.pop()
print("".join(stack))

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

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

Solution (Python):
S = input()

Z = []
X = len(S)

i = 0
while i  < X :
    if S[i] == "0":
        Z.append(0)
    elif S[i] == "1":
        Z.append(1)
    elif S[i] == "B":
        if len(Z)== 0:
            pass
        else:
            Z.pop()
    i += 1

i = 0
X = len(Z)
while i < X:
    print(Z[i] , end ="")
    i +=1

Solution (Python):
S = input()

Z = []
X = len(S)

i = 0
while i  < X :
    if S[i] == "0":
        Z.append(0)
    elif S[i] == "1":
        Z.append(1)
    elif S[i] == "B":
        if len(Z)== 0:
            pass
        else:
            Z.pop()
    i += 1

i = 0
X = len(Z)
while i < X:
    print(Z[i] , end ="")
    i +=1

Solution (Python):
s = list(input())
ans = [""] * 10
ptr = 0
for c in s:
    if c == "B":
        ptr = max(0,ptr-1)
    else:
        ans[ptr] = c
        ptr += 1

print("".join(ans[:ptr]))

Solution (Python):
com = list(input())
ans = []
for c in com:
    if c == '0':
        ans.append("0")
    elif c == '1':
        ans.append("1")
    elif c == 'B':
        if len(ans) == 0:
            pass
        else:
            ans.pop()
a = "".join(ans)
print(a)

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

Solution (Python):
s = list(input())
word = []
for i in range(len(s)):
    if s[i] == "B":
        if len(word) != 0:
            del word[len(word)-1]
    else:
        word.append(s[i])
Ans = ""
for i in range(len(word)):
    Ans += word[i]
print(Ans)

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

Solution (Python):
s = input()

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

print(''.join(l))

Solution (Python):
S = input()

stack = []
for s in S:
    if s == '0' or s == '1':
        stack.append(s)
    if s == 'B':
        if not stack:
            continue
        else:
            stack.pop()

print(''.join(stack))

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

Solution (Python):
x = str(input())
lst = []

for i in range(len(x)):
  if x[i] == 'B':  
    if len(lst) >0:
      lst.pop()
  else:
    lst.append(x[i])
print("".join(lst))

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

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

Solution (Python):

def main():
    s = list(input())
    val = []

    for i in s:
        if len(val) == 0 and i == 'B':
            continue
        elif i == 'B':
            val.pop(-1)
        else:
            val.append(i)
    else:
        print(''.join(val))
 
    
if __name__ ==  "__main__":
    main()

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

Q = collections.deque()

for i in range (0, len(S)):
	if S[i] == 'B':
		if len(Q) >= 1:
			D = Q.pop()
	else:
		Q.append(S[i])

T = str()
while Q:
	V = Q.popleft()
	T=T+V
    
print(T)

Solution (Python):
s=input()

out=''
for i in range(len(s)):
  if s[i] != 'B':
    out += s[i]
    continue
  else:
    if len(out):
      out = out[:-1]
      
print(out)

Solution (Python):
s1 = str(input())
s = []
for i in s1:
    if i == '0' or i == '1':
        s.append(i)
    else:
        if 1 <= len(s):
            s.pop(len(s)-1)
w = ""
for h in s:
    w += h
print(w)

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

Solution (Python):
s = input()

ans = []

back = 0

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

print("".join(ans))

Solution (Python):
s = input()

while s.count("B") != 0:
    if s[0] == "B":
        s = s[1:]
    else:
        i = s.index("B")
        s = s[:i-1] + s[i+1:]
print(s)

Solution (Python):
s = input()
for i in range(len(s)):
    s=s.replace('0B', '')
    s=s.replace('1B', '')
s=s.replace('B', '')
print(s)

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

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

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

Solution (Python):
s=input()
stk=[]
for c in s:
    if c in '01':
        stk.append(c)
    elif stk:
        stk.pop()
 
print(''.join(stk))

Solution (Python):
s = input()

lis = []
for k in s:
  if k == "B":
    if len(lis) != 0:
      lis.pop()
  else:
    lis.append(k)

print("".join(lis))

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

i = 0
while i < len(s):
    if s[i] == "B":
        if i == 0:
            del s[0]
            i -= 1
        else:
            del s[i-1:i+1]
            i -= 2

    i += 1

print("".join(s))

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

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


print("".join(ans))

Solution (Python):
s=input()
stk=[]
for c in s:
    if c in '01':
        stk.append(c)
    elif stk:
        stk.pop()

print(''.join(stk))

Solution (Python):
s=input()
ans,skip='',0
for c in reversed(s):
    if c=='B':
        skip+=1
    elif skip:
        skip-=1
    else:
        ans+=c

print(ans[::-1])

Solution (Python):
s=input()
stk=[]
for c in s:
    if c in '01':
        stk.append(c)
    elif stk:
        stk.pop()

print(''.join(stk))

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

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

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

Solution (Python):
s=str(input())
C= list(s)
list=[]
for I in range(len(C)):
    if C[I]!='B':
        list.append(C[I])
    elif C[I]=='B' and len(list)!=0:
        list.pop()
 
print("".join(list))

Solution (Python):
s=str(input())
C= list(s)
list=[]
for I in range(len(C)):
    if C[I]!='B':
        list.append(C[I])
    elif C[I]=='B' and len(list)!=0:
        list.pop()
 
print("".join(list))

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

Solution (Python):
input = input()
output = ""

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

print(output)

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

for i in range(len(S)):
    if(S[i] != 'B'):
        ans.append(S[i])
    elif(S[i] == 'B' and len(ans) != 0):
        ans.pop()

        
print(''.join(ans))

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

Solution (Python):
S = input()

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

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

print("".join(ans))

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

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

Solution (Python):








s = input()

ans = []

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

for i in range(len(ans)):
    print(ans[i], end="")

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

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

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

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

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

Solution (Python):
s=input()

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

print(ans)

Solution (Python):
S=str(input())
T=''
for i in range(len(S)):
    if S[i]=='0' or S[i]=='1':
        T+=S[i]
    else:
        T=T[:-1]
print(T)

Solution (Python):

s = input()
c = list(s)
ans_list = []

for i in range(len(s)):
    if(c[i]=="0" or c[i]=="1"):
        ans_list.append(c[i])
    else:
        try:
            ans_list.pop(-1)
        except:
            a = 0

print("".join(ans_list))

Solution (Python):
import re
text = input()
b_length = len(re.sub('[^B]', '', text))
for _ in range(b_length):
    text = re.sub('(0|1)??B', '', text, 1)
print(text)

Solution (Python):
s = input()

n = len(s)
s_ans = ""

for i in range(n):
    if s[i] == "0":
        s_ans = s_ans + "0"

    elif s[i] == "1":
        s_ans = s_ans + "1"

    elif s[i] == "B":
        len_ans = len(s_ans)
        if len_ans >= 1:
            s_ans = s_ans[:len_ans-1]

        elif len_ans == 0:
            s_ans = s_ans

        else:
            print("error2")

    else:
        print("error1")

print(s_ans)

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

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

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate 

from collections import deque,defaultdict,Counter
import decimal
import re












import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
s = input()
ans = ""
for i in range(len(s)):
    if s[i] == '0':
        ans += '0'
    elif s[i] == '1':
        ans += '1'
    else:
        ans = ans[:-1]
print(ans)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

S = list(input())
lis = []
for s in S:
    if s=='0':
        lis.append(str(0))
    if s=='1':
        lis.append(str(1))
    if s=='B':
        if len(lis):
            lis.pop()

print(''.join(lis))

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

Solution (Python):





import math
import fractions
import sys
import bisect
import heapq  
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr



def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod



def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors


inf = 10 ** 18
mod = 10 ** 9 + 7

s = sr()
st = []
for c in s:
    if c == '0':
        st.append('0')
    elif c == '1':
        st.append('1')
    else:
        if st:
            st.pop()
print(''.join(st))

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')
  else:
    if ans:
      ans.pop()
print(''.join(ans))

Solution (Python):
s = input()

ans = []
for l in s:
    if l == '0':
        ans.append('0')
    elif l == '1':
        ans.append('1')
    else:
        if ans:
            ans.pop()

print(''.join(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 solve():
  S = input()
  ans = []
  for s in S:
    if s!='B':
      ans.append(s)
    else:
      if len(ans):
        ans.pop(-1)
  ans = ''.join(ans)
  return ans
print(solve())

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

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

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

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

Solution (Python):
s = input()

st = []

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

print("".join(st))

Solution (Python):
S=[x for x in input()]
ans=[]
for i in range(len(S)):
  if S[i]!='B':
    ans.append(S[i])
  else:
    try:
      ans.pop()
    except:
      continue
print(''.join(ans))

Solution (Python):
from collections import deque
S = input()
T = deque([])
for s in S:
  if s=="B" and len(T)>0:
    T.pop()
  elif s=="B":
    pass
  else:
    T.append(s)
print("".join(T))

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

Solution (Python):
from sys  import stdin,stdout

import bisect

import math

def st():
    return list(stdin.readline().strip())

def inp():
    return int(stdin.readline())

def li():
    return list(map(int,stdin.readline().split()))

def mp():
    return map(int,stdin.readline().split())

def pr(n):
    stdout.write(str(n)+"\n")

def soe(limit):
    l=[1]*(limit+1)
    prime=[]
    for i in range(2,limit+1):
        if l[i]:
            for j in range(i*i,limit+1,i):
                l[j]=0

    for i in range(2,limit+1):
        if l[i]:
            prime.append(i)
    return prime

def segsoe(low,high):
    limit=int(high**0.5)+1
    prime=soe(limit)
    n=high-low+1
    l=[0]*(n+1)
    for i in range(len(prime)):
        lowlimit=(low//prime[i])*prime[i]
        if lowlimit<low:
            lowlimit+=prime[i]
        if lowlimit==prime[i]:
            lowlimit+=prime[i]
        for j in range(lowlimit,high+1,prime[i]):
            l[j-low]=1
    for i in range(low,high+1):
        if not l[i-low]:
            if i!=1:
                print(i)
                
def gcd(a,b):
    while b:
        a=a%b
        b,a=a,b
    return a

def power(a,n):
    r=1
    while n:
        if n&1:
            r=(r*a)
        a*=a
        n=n>>1
    return r

def check(n,s):
    v=str(n)
    for i in v:
        if i in s:
            return False
    return True
    

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

for _ in range(1):
    solve()

Solution (Python):


def solve(s):
  l = []
  for c in s:
    if c == "0" or c == "1":
      l.append(str(c))
    elif len(l):
      l.pop()
  return "".join(l)




def main():
  s = input()
  print(solve(s))
  return

if __name__ == '__main__':
  main()

Solution (Python):
s = input()

ans = ''

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

print(ans)

Solution (Python):
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    s = input()
    edge = collections.deque()
    for i in s:
        if i == "0":
            edge.append("0")
        elif i == "1":
            edge.append("1")
        elif len(edge) > 0:
            edge.pop()
    print("".join(edge))
    return 0

if __name__ == "__main__":
    solve()

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

Solution (Python):
def main():
    s=input()
    li=[]
    for i in range(len(s)):
        if(s[i]!='B'):
            li.append(s[i])
        else:
            if(len(li)!=0):
                li.pop()
    for i in li:
        print(i,end='')

main()

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

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

Solution (Python):
from collections import deque
S = input()

def calculate(s):
    q = deque()
    for i in range(len(s)):

        if s[i] == "0":
            q.append("0")
            continue

        if s[i] == "1":
            q.append("1")
            continue

        if s[i] == "B":
            if len(q) > 0:
                q.pop()


    if len(q) == 0:
        print("(empty)")
    else:
        print("".join(list(q)))


calculate(S)

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

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

n = len(ans)
for i in range(n-1):
	print(ans[i], end="")
print(ans[n-1])

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

Solution (Python):
s = input()

ans  = ''

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

print(ans)

Solution (Python):
s = input()

res = ""

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

print(res)

Solution (Python):
s=input()
stack =[]
for i in s:
    if i != "B":
        stack.append(i)
    else:
        if not stack:
            continue
        else:
            stack.pop()
print("".join(stack))

Solution (Python):
from collections import deque
s = input()
lst = deque()
for i in range(len(s)):
  if s[i] == 'B':
    if len(lst) > 0:
      lst.pop()
    else:
      pass
  else:
    lst.append(s[i])
print(''.join(list(lst)))

Solution (Python):

import re

s = input()
for i in range(5):
    s = re.sub(r"\dB", "", s)
print(s.replace("B", ""))

Solution (Python):
from collections import deque
S=input()
ans=[]
ans=deque(ans)
for letter in S:
    if letter=='0':
        ans.append('0')
    elif letter=='1':
        ans.append('1')
    else:
        if len(ans)!=0:
            ans.pop()

print(''.join(ans))

Solution (Python):
import sys
def LS2(): return list(sys.stdin.readline().rstrip())  

s = LS2()
ans = []
for a in s:
    if a != 'B':
        ans.append(a)
    else:
        if len(ans) != 0:
            del ans[-1]

print(''.join(ans))

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