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()
l=[]
for s in S:
    if s=="0" or s=="1":
        l.append(s)
    else:
        if l==[]:
            pass
        else:
            del l[-1]
print("".join(l))

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

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

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

Solution (Python):
s = input()

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

print(r)

Solution (Python):
s = raw_input()

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

Solution (Python):
keys = input()
outputs = []

for key in keys:
    if key == 'B':
        if not outputs:
            pass
        else:
            outputs.pop()
    else:
        outputs.append(key)

for output in outputs:
    print(output, end='')

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

for char in m:
    l.append(char)

k = []

for i in range(len(l)):
        if l[i] == "B":
            if k == []:
                pass
            else: k = k[:(len(k))-1]
        else: k.append(l[i])

result = ""
for j in k:
    result += j

print(result)

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

for i in s:
    if i in ["0", "1"]:
        ans.append(i)
    else:
        if len(ans):
            ans.pop()

print("".join(ans))

Solution (Python):
s = input()
ans = []
for c in s:
    if (c == 'B'):
        if (len(ans) > 0):
            ans.pop(-1)
    else:
        ans.append(c)

print(''.join(ans))

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    S=ST()
    ans = []
    for s in S:
        if s=="0":
            ans.append(0)
        elif s=="1":
            ans.append(1)
        else:
            if ans:
                ans.pop()
    print(*ans,sep="")
if __name__ == '__main__':
    main()

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

Solution (Python):
import math

commands = input()
result = ""
for sym in commands:
	if (sym == "B"):
		if (len(result) > 0):
			result = result[:-1]
	else:
		result += sym
print(result)

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

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

lis = list(S)
t = ''

for u in lis:

    if u == '0' or u == '1':
        t =  t + u
    elif u == 'B' and len(t) > 0:
        t = t[:-1]
 
print(t)

Solution (Python):

import sys

s = sys.stdin.readline().rstrip()
ans =''
for c in s:
    if c =='0':
        ans +='0'
    elif c =='1':
        ans +='1'
    elif c =='B':
        ans = ans[0:-1]
print(ans)

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

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

Solution (Python):
a=list(input())
gamen=[]
for i in range (len(a)):
  if a[i]=='0':
    gamen.append('0')
  if a[i]=='1':
    gamen.append('1')
  if a[i]=='B':
    if gamen==[]:
      continue
    else:
      del gamen[-1]
mpjiretsu = ''.join(gamen)

print(mpjiretsu)

Solution (Python):
from collections import deque
s = list(str(input()))
ans = deque()
for i in s:
  if i == "B":
    if ans == deque([]):
      continue
    else:
      ans.pop()
  else:
    ans.append(i)
print("".join(ans))

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

Solution (Python):


S=input()
A=[""]

for s in S: 
    if s in ["0","1"]: 
        A.append(s)
    elif s=="B": 
        if len(A)>=1: 
            A.pop(-1)

print("".join(A))

Solution (Python):
s = input()
N = len(s)
A = str()

for i in range(N):
    if s[i] == 'B':
        A = A[:-1]
    elif s[i] == '0':
        A += '0'
    elif s[i] == '1':
        A += '1'

print(A)

Solution (Python):

import sys, math, itertools, heapq, collections, bisect, fractions
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = []
count = 0

s=input()
for si in s:
    if si=="1":
        ans.append(1)
    elif si=="0":
        ans.append(0)
    else:
        if ans:
            ans.pop()
print(*ans,sep='')

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

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

ans = []
for i in range(N):
	if s[i] == "0" or s[i] == "1":
		ans.append(s[i])
	else:
		if ans != []:
			ans.pop()

print("".join(ans))

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

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

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

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

print(ans)

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

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

Solution (Python):
s = input()

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

Solution (Python):
from collections import deque

def main():
    s = input()
    ans = deque()

    for i in s:
        if i == '0' or i == '1':
            ans.append(i)
        elif i == 'B' and len(ans)>0:
            ans.pop()

    print(''.join(ans))

if __name__ == '__main__':
    main()

Solution (Python):
def main():
    s = input()
    ans = []
    
    for i in s:
        if i == '0' or i == '1':
            ans.append(i)
        elif i == 'B' and len(ans)>0:
            ans.pop()

    print(''.join(ans))

if __name__ == '__main__':
    main()

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

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

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

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

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

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

Solution (Python):
s = input()

ans = []
for x in s:
    if x == "0":
        ans.append("0")
    elif x == "1":
        ans.append("1")
    else:
        if ans == []:
            pass
        else:
            ans.pop()

print("".join(ans))

Solution (Python):
S = list(input())
W = []
for i in S:
    if i == "0":
        W.append("0")
    elif i == "1":
        W.append("1")
    elif i == "B":
        if len(W) == 0:
            W = W
        else:
            W.pop(-1)
print(*W, sep="")

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

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

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

print("".join(ans))

Solution (Python):
S=list(input())
L=[]
while S:
  if S[0]=="B":
    if L:
      del L[len(L)-1]
  else:
    L.append(S[0])
  del S[0]
print("".join(L))

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

Solution (Python):
s = list(input())
ans_list=[]
for i in range(len(s)):
    if(s[i] == "0"):
        ans_list.append("0")
    elif(s[i] == "1"):
        ans_list.append("1")
    elif(s[i] == "B"):
        if(len(ans_list) != 0):
            ans_list.pop()
        else:
            continue
for i in range(len(ans_list)):
    print(ans_list[i],end='')

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

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

Solution (Python):

from collections import defaultdict
import sys
sys.setrecursionlimit(10**8)
input = sys.stdin.readline

s = input().rstrip()
ans = []
for ch in s:
    if ch == "0":
        ans.append("0")
    elif ch == "1":
        ans.append("1")
    else:
        if len(ans) > 0:
            ans.pop()
print("".join([item for item in ans]))

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

for i in range(len(list)):
    x += list[i]

print(x)

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

for i in range(len(s)):
  if s[i] != "B":
    stack += [s[i]]
  else:
    if stack:
      stack.pop()
print("".join(stack))

Solution (Python):
N = list(input().strip())
a=len(N)
count = []
counter = 0
for n,i in zip(N,range(a)):
  if n != 'B':
    count.append(int(n))
  else:
    if len(count) == 0:
      pass
    else:
      del(count[len(count)-1]) 
p = ''.join(map(str,count))
print(p)

Solution (Python):

s = str(input())

ans = []

for i in s:
  if i == "0":
    ans.append("0")
  elif i == "1":
    ans.append("1")
  else:
    if len(ans) == 0:
      pass
    else:
      ans = ans[:-1]

print("".join(ans))

Solution (Python):
s = list(input())
ans = []
for char in s:
    if char == "B":
        if ans:
            ans.pop(-1)
        else:
            pass
    else:
        ans.append(char)

print("".join(ans))

Solution (Python):
def examB():
    from collections import deque
    St = S()
    que = deque()
    for s in St:
        if s=="B":
            if que:
                que.pop()
        else:
            que.append(s)
    ans = list(que)
    print("".join(map(str,ans)))


import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

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

ans = []
for k in ks:
  if k == "B":
    if len(ans) > 0:
      ans.pop()
  else:
    ans.append(k)
print("".join(ans))

Solution (Python):
import sys
from collections import defaultdict
input = sys.stdin.readline


def main():
    s = input().strip()
    ans = ""
    for c in s:
        if c == "B":
            ans = ans[:-1]
        else:
            ans += c
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
s = input()

t = ''
for i in range(len(s)):
    if s[i] != 'B':
        t += s[i]
    elif len(t) >= 1:
        t = t[:-1]

print(t)

Solution (Python):

s = input()
editor = ''

for key in s:
    if key == '0':
        editor += '0'
    elif key == '1':
        editor += '1'
    elif key == 'B':
        if editor != '':
            editor = editor[:-1]

print(editor)

Solution (Python):
s=input()
n=len(s)
res=''
for i in range(n):
  if s[i]=='0':res=res+'0'
  elif s[i]=='1':res=res+'1'
  else:
    if res=='':continue
    else:
      res=res[:-1]
print(res)

Solution (Python):

import sys
input = sys.stdin.readline


S = input()

ans = ""
for s in S:
    if s=="B":
        ans = ans[:-1]
    else:
        ans += s

print(ans)

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

print(ans)

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

for y in s:
    if y == '0':
        moji.append('0')
    if y == '1':
        moji.append('1')
    if y == 'B'and moji!= []:
        sakuzyo = moji.pop(-1)

print(''.join(moji))

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

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

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

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 i !=  0:
            ans = ans[:-1]
        
print(ans)

Solution (Python):
from collections import deque

S = input()
d = deque()
for s in S:
    if s == 'B':
        if len(d) >= 1:
            d.pop()
    else:
        d.append(s)
answer = list(d)
print(*answer, sep='')

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

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

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

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

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

Solution (Python):

s = input()
r = ""
for i in range (0,len(s)):
    if s[i:i+1] == "0":
        r = r + '0'
    elif s[i:i+1] == "1":
        r = r + '1'
    else:
        if r != "":
            r = r[0:len(r)-1]
        else:
            pass
print(r)

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

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

for i in range(len(s)):
  if s[i] == '0':
    ans_list.append('0')
  if s[i] == '1':
    ans_list.append('1')
  if ans_list == []:
    pass
  else:
    if s[i] == 'B':
      ans_list.pop(-1)

ans = ''.join(ans_list)
print(ans)

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

for i in s:
    if i == "B":
        if len(S) != 0:
            S.pop(-1)
        else:
            pass
    else:
        S.append(i)

print(*S, sep="")

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' and len(L) > 0:
    del L[-1]

print(''.join(L))

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

Solution (Python):
s = input()
s_list = [c for c in s]
output = []

for i in range(len(s)):
    if s_list[i] == '0':
        output.append('0')
    elif s_list[i] == '1':
        output.append('1')
    else:
        if len(output) > 0:
            output.pop()

print(''.join(output))

Solution (Python):
s=input()

text=[]
for i in s:
    if(i=='0'):
        text.append(0)
    elif(i=='1'):
        text.append(1)
    else:
        text=text[:-1]
t=''
for i in text:
    t+=str(i)
print(t)

Solution (Python):
s = input()

result = ''
for char in s:
    if char == 'B':
        result = result[:len(result)-1]
    else:
        result += char

print(result)

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

Solution (Python):
s=list(input())
ans=[]
for i in s:
  ans.append(i)
  if ans[0]=="B":
    ans.pop(0)
  elif i=="B":
    ans.pop(ans.index(i)-1)
    ans.pop(ans.index(i))
for i in ans:
  print(i,end="")

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

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

a=''

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

Solution (Python):
s = str(input())
n = len(s)
a = []
for i in range(n):
    if s[i] != 'B':
        a.append(s[i])
    else:
        if len(a) != 0:
            a.pop(-1)
t =''
m = len(a)
for j in range(m):
    t += a[j]
print(t)

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

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

Solution (Python):
s = input()

ans = []
for _s in s:
    if _s == "0":
        ans.append(0)
    elif _s == "1":
        ans.append(1)
    elif _s == "B" and len(ans) > 0:
        ans.pop()

print("".join(map(str, 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 t:
            del t[-1]
print(''.join(t))

Solution (Python):
s = list(input())
e = []
for i in range(len(s)):
    if e == []:
        if (s[i] == "0") or (s[i] == "1"):
            e.append(s[i])
    else:
        if (s[i] == "0") or (s[i] == "1"):
            e.append(s[i])
        else:
            del e[-1]
f = "".join(e)
print(f)

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

for i in range(len(s)):
    if(s[i]=="B"):
        s[i]="A"
        for j in range(i,-1,-1):
            if((s[j]=="0")|(s[j]=="1")):
                s[j]="A"
                break

for C in s:
    if(C!="A"):
        print(C,end="")

Solution (Python):
arr =list(input())
ret=""
for st in arr:
  if(st == "B"):
    ret = ret[:len(ret)-1]
  else:
    ret = ret + st
      
print(ret)

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

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

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

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

Solution (Python):
s = input()
ans = []
for i in s:
    if i =='B':
        try:
            ans.pop()
        except:
            continue
    else:
        ans.append(i)
print("".join(i for i in ans))

Solution (Python):
input_line = input()
str = ""

for i in range(0,len(input_line)):
  if input_line[i] == '0':
    str += "0"
  elif input_line[i] == '1':
    str += "1"
  elif input_line[i] == 'B':
    str = str[:-1]
else:
  print(str)

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

Solution (Python):
from collections import Counter,defaultdict,deque
import sys,bisect,math,itertools,string,queue
from heapq import heappop, heappush
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

s = input()
q = deque([])
L = ''
for i in range(len(s)):
    if s[i] == '0':
        q.append('0')
    elif s[i] == '1':
        q.append('1')
    else:
        if q:
            q.pop()
while q:
    L += q.popleft()
print(L)

Solution (Python):
s = input()
letters = [letter for letter in s]

res = []

for letter in letters:
    if letter == "B":
        if res:
            res.pop()
    else:
        res.append(letter)

ans = ''.join(res)
print(ans)

Solution (Python):


s = list(input())
ans = []

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

print("".join(ans))

Solution (Python):
slist=list(input())
alist=[]
for i in slist:
	if i=="B":
		alist=alist[:-1]
	else:
		alist.append(i)
print(*alist,sep="")

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

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

for i in s:
    if i=='0':
        w.append('0')
    elif i=='1':
        w.append('1')
    else:
        if w!=[]:
            w.pop()

print(''.join(w))

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

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

ans = ""
for j in ans_l:
    ans = ans + j

print(ans)

Solution (Python):


s = input()
display = []
for i in s:
    if i == "0":
        display.append("0")
    elif i == "1":
        display.append("1")
    else:
        if display == []:
            continue
        else:
            display.pop(-1)


ans="".join(display)
print(ans)

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

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

Solution (Python):

si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

S = si()
ans = ''
for s in S:
    if s == '0':
        ans += '0'
    elif s == '1':
        ans += '1'
    elif s == 'B':
        n = len(ans)
        if n > 0:
            ans = ans[0:n-1]
print(ans)

Solution (Python):
from itertools import groupby as gb
s=""
for i,b in gb(input()):
  if i=="B":
    s=s[:-len(list(b))]
  else:s+=i*len(list(b))
print(s)

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

Solution (Python):

s = list(str(input()))

r = ''
for i in s:
  if i == 'B' and r == '':
    continue
  if i == 'B':
    r = r[:-1]
    continue
  r += i
  
print(r)

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

for k in s:
  if(k == "0" or k == "1"):
    result += k
  else:
    if(result != ""):
      result = result[:-1]
      
print(result)

Solution (Python):
s = input()
j = 0
for i in range(len(s)):
    
    if s[i-(2*j)] == "B":
        
        
        if s[0] == "B":
            s = 'x'+s[1:]
            
            
        else:
            
            s = s[:i-1-(2*j)]+s[i-(2*j)+1:]
            j += 1
            
            
            
ans = s.replace('x','')
print(ans)

Solution (Python):


def delete_letter(result):
    if len(result) == 0:
        return result
    return result[:-1]


s = input()
result = ''
for c in s: 
    if c == 'B':
        result = delete_letter(result)
    else:
        result += c

print(result)

Solution (Python):
s = [str(i) for i in list(str(input()))]
x = list()
for i in s:
    if i == "0" or i == "1":
      x.append(i)
    elif i== "B" and x != []:
        x.pop(-1)
print(','.join(x).replace(",",""))

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

for s in S:
  if s == 'B':
    if stack:stack.pop()
  else:
    stack.append(s)
    
    
print(*stack, sep = '')

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):
from collections import deque


def check(s):
    queue = deque()

    for c in s:
        if c == 'B':
            if len(queue) > 0:
                queue.pop()
        else:
            queue.append(c)

    return ''.join(queue)


def main():
    S = input()
    result = check(s=S)
    print(result)


if __name__ == '__main__':
    main()

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

Solution (Python):
s=input()
buff=[]
for x in s:
  if x == "0" or x == "1":
    buff.append(x)
  else:
    if len(buff) > 0:
      buff.pop()
print("".join(buff))

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

memo = 0
a = [-1 for i in range(10)]

for i in range(len(s)):
    if s[i] == '0':
        a[memo] = 0
        memo += 1
    elif s[i] == '1':
        a[memo] = 1
        memo += 1
    elif s[i] == 'B' and memo >0:
        memo -= 1
    
for i in range(memo):
    if a[i] != -1:
        print(a[i],end ="")

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

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

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

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

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

R = ''

for s in S:
    if s == 'B':
        R = R[:-1]
    else:
        R = R + s

print(R)

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

Solution (Python):
s = input()

out = []
bc = 0
for j in range(len(s) - 1, -1, -1):
    if s[j] == 'B':
        bc += 1
    elif bc > 0:
        bc -= 1
    else:
        out.append(s[j])
ans = "".join(reversed(out))
print(ans)

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

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

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

for i in range(len(List)):
  if List[i] == '0': ans.append('0')
  elif List[i] == '1': ans.append('1')
  else:
    if ans == []: pass
    else: ans.pop(-1)
      
for i in range(len(ans)):
  print(ans[i], end = '')

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

ans = ""
add = ""

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]

if len(ans) == 0:
    for i in range(len(s)):
        if s[i] != "B":
            add = s[i]
    ans = add

print(ans)

Solution (Python):
ans = ''
for c in input():
    if c == '0':
        ans += '0'
    elif c == '1':
        ans += '1'
    elif ans != '':
        ans = ans[:len(ans) - 1]

print(ans)

Solution (Python):
S = input()

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

print(s)