Problem:
 Score : 200 points    Problem Statement Sig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.  To begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:   The 0 key: a letter 0 will be inserted to the right of the string.  The 1 key: a letter 1 will be inserted to the right of the string.  The backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.   Sig has launched the editor, and pressed these keys several times. You are given a string s , which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?      Constraints  1 ≦ |s| ≦ 10 ( |s| denotes the length of s )  s consists of the letters 0 , 1 and B .  The correct answer is not an empty string.         Input The input is given from Standard Input in the following format:  s       Output Print the string displayed in the editor in the end.        Sample Input 1 01B0      Sample Output 1 00  Each time the key is pressed, the string in the editor will change as follows: 0 , 01 , 0 , 00 .       Sample Input 2 0BB1      Sample Output 2 1  Each time the key is pressed, the string in the editor will change as follows: 0 , (empty) , (empty) , 1 .

Solution (Python):
import sys

def main():
    s = input()
    output = ''
    for i in s:
        if i == 'B':
            output = output[0:-1]
        else:
            output += i
    print(output)

if __name__ == "__main__":
    main()

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

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

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

tmp = [0] * 10
num = 0
for i in range(len(s)):
    if s[i] == "0":
        tmp[num] = "0"
        num += 1
    elif s[i] == "1":
        tmp[num] = "1"
        num += 1
    else:
        num = max(0, num-1)

for i in range(num):
    print(tmp[i],end="")
print()

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

output = []
for key in Key_in:
    if key == '0':
        output.append('0')
    elif key == '1':
        output.append('1')
    elif key =='B':
        if len(output) != 0:
            output.pop()
        else:
            pass

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

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

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

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

print(res)

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

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

print(res)

Solution (Python):
from sys import stdin
s = (stdin.readline().rstrip())
ans = ""
for i in s:
    if i == "0":
        ans = ans + "0"
    elif i == "1":
        ans = ans + "1"
    elif i == "B" and len(ans) != 0:
        ans = ans[:-1]
print(ans)

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

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

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

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

Solution (Python):
s = input()

ret = []
for s_ in s :
    if s_ == 'B' :
        if len(ret) != 0 :
            ret.pop()
    else :
        ret.append(s_)

print(''.join(ret))

Solution (Python):
s = list(str(input()))
sentence = []
ans = ''

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

for i in range(len(sentence)):
    ans += str(sentence[i])

print(ans)

Solution (Python):
s = list(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.pop()
print("".join(ans))

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()
t = ""
for i in s :
    if i=="0" :
        t+="0"
    elif i=="1" :
        t+="1"
    elif t=="" :
        pass
    else :
        t=t[:-1]
print(t)

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

Solution (Python):
import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
























S = sys.stdin.readline().rstrip()

ans = []
for c in S:
    if c == 'B':
        if ans:
            ans.pop()
    else:
        ans.append(c)

print(''.join(ans))

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

for c in lst:
    if c=='1':
        ans += '1'
    elif c=='0':
        ans += '0'
    elif c=='B' and len(ans)!=0:
        ans =  ans[:-1]
print(ans)

Solution (Python):
list = input()

ans = []
for i in list:
    if i=="B" and len(ans)!=0:
        ans.pop()
    elif i=="0" or i=="1":
        ans.append(i)
print("".join(ans))

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

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

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

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

for s in a:
  if s=="0" or s=="1":
    b.append(s)
  elif s=="B" and len(b)!=0:
    b.pop()
else:
  print("".join(b))

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 l==[]:
      pass
    else:
      l.pop(-1)


print(*l,sep="")

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

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

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

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

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 = input()
ans = ''
for i in s:
    if i == '0' or i == '1':
        ans = ans + i
    elif len(ans) != 0 and i == 'B':
        ans = ans[:-1]
print(ans)

Solution (Python):
from collections import Counter
from collections import deque
from functools import reduce
from pprint import pprint
import bisect
import copy
import fractions
import itertools
import math
import queue
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers): return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers): return reduce(LCM, numbers)
def LCM(m, n): return (m * n // fractions.gcd(m, n))
class UnionFind():

    def __init__(self, n):
        self.n = n
        self.node = [i for i in range(n)]
        self.size = [1 for _ in range(n)]

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

    def root(self, x):
        if self.node[x] == x:
            return x
        else:
            self.node[x] = self.root(self.node[x])
            return self.node[x]

    def unite(self, x, y):
        x, y = self.root(x), self.root(y)
        if x == y:
            return  
        if self.size[x] < self.size[y]:
            x, y = y, x
        self.node[y] = x
        self.size[x] += self.size[y]

    def return_size(self, x):
        return self.size[self.root(x)]


s = IS()
stack = []
for input_key in s:
    if input_key == '0':
        stack.append('0')
    elif input_key == '1':
        stack.append('1')
    else:  
        if len(stack) > 0:
            stack.pop()
print(''.join(stack))

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):
from collections import deque
from sys import stdin
s = stdin.readline().rstrip()
ans = deque()
for c in s:
  if c == 'B' and len(ans) != 0:
    ans.pop()
  elif c == '0' or c == '1':
    ans.append(c)
print(''.join(ans))

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

Solution (Python):
S = list(input())
result = ''
for key in S:
    if( key == '0' or key == '1' ):
        result += key
    if( key == 'B' ):
        result = result[:-1]
print(result)

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

for c in s:
    if c=="B" and ans=="":
        continue
    if c=="B":
        ans=ans[:-1]
    elif c=="0":
        ans+="0"
    elif c=="1":
        ans+="1"

print(ans)

Solution (Python):
def main():
    keylist = input()

    word = ''

    for key in keylist:
        if key == 'B':
            word = word[:-1]
        else:
            word += key

    print(word)

    
    
    
    
    
    
    
    
    
    

if __name__ == "__main__":

    main()

Solution (Python):
def main():
    keylist = input()
    word = []

    for key in keylist:
        if key == 'B':
            if word:
                word.pop()
        else:
            word.append(key)

    print(''.join(word))

if __name__ == "__main__":

    main()

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

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

Solution (Python):
s = input()

ans = ''

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

Solution (Python):



i_list = list(input())
o_list = []

for i in range(len(i_list)):
    if i_list[i] == "0":
        o_list.append("0")
    elif i_list[i] == "1":
        o_list.append("1")
    elif len(o_list) >= 1:
        del o_list[-1]

for j in range(len(o_list)):
    print(o_list[j], end = "")

Solution (Python):
s = input()
s_list = list(s)
out_list = []

for i in range(len(s_list)):
    if s_list[i] == "0":
        out_list.append("0")
    elif s_list[i] == "1":
        out_list.append("1")
    elif s_list[i] == "B":
        if out_list:
            del out_list[-1]

for ol in out_list:
    print(ol, end="")

Solution (Python):
IN = input()
OUT = []

for order in IN:
    if order == "B" and len(OUT) != 0:
        OUT.pop()
    elif order == "0" or order == "1":
        OUT.append(order)

print("".join(OUT))

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

Solution (Python):
s = input()
res =[]
for i in range(len(s)):
	if s[i] == 'B':
		if len(res) != 0:
			res.pop(len(res)-1)
		continue
	res.append(s[i])

print("".join(res))

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

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

Solution (Python):
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

S = s()

res = ''
for c in S:
    if c == '0':
        res += '0'
    elif c == '1':
        res += '1'
    elif len(res) > 0:
        res = res[:-1]

print(res)

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

Solution (Python):
s=input().rstrip()
l=[]
x=list(s)
for i in range(0,len(x)):
  if x[i]=='0':
    l.append(0)
  elif x[i]=='1':
    l.append(1)
  else:
    if len(l)!=0:
      del(l[len(l)-1])
for i in range(0,len(l)):
    print(l[i],end='')

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

Solution (Python):
def abc():
    s = input().rstrip()
    ans = []
    for _s in s:
        if _s == 'B':
            if len(ans) > 0:
                ans.pop()
            continue
        ans.append(_s)
    print(''.join(ans))


abc()

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math
import sys

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

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())


s = str(input())

ans = []
for i in range(len(s)):
    if s[i] == "0":
        ans.append("0")
    elif s[i] == "1":
        ans.append("1")
    else:
        if len(ans) > 0:
            ans.pop(-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:ans=ans[:-1]
print(ans)

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

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

print(ans)

Solution (Python):
s = input()

ans = []
for w in s:
    if w == 'B' and len(ans) > 0:
        ans.pop()
    elif w != 'B':
        ans.append(w)

print(''.join(ans))

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

pos = s.find('B')
while pos > -1:
    if pos == 0:
        s = s[1:]
    elif pos == len(s) - 1:
        s = s[0:pos - 1]
    else:
        s = s[0:pos - 1] + s[pos + 1:]
    pos = s.find('B')
print(s)

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

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

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':
        if len(ans) != 0:
            ans.pop(-1)

print(''.join(ans))

Solution (Python):
s=input()
a=[]
def b(x):
  if len(x)!=0:
    x=x[:len(x)-1]
  return x
for i in range(len(s)):
  if s[i]=='B':
    a=b(a)
  else:
    a.append(s[i])
for _ in range(len(a)):
  print(a[_],end='')

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

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

Solution (Python):
S = input()

ans = []
for s in S:
    if s == "B":
        if len(ans) != 0:
            ans.pop()
    else:
        ans.append(s)
print("".join(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" and len(r) != 0:
        del r[-1]

    else:
        continue
print("".join(r))

Solution (Python):
s = input()
ans = []
 
for ch in s:
  if ch == "0" or ch == "1":
    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 i in s:
    if i == '0':
        ans += '0'
    elif i == '1':
        ans += '1'
    elif i == 'B':
        if len(ans) != 0:
            ans = ans[:-1]
print(ans)

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

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

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

for c in S:
  if c != 'B':
    lis.append(c)
  elif len(lis)>=1:
    lis.pop()

print(''.join(lis))

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

Solution (Python):
s = input()
ans = ''
for i in range(len(s)):
  if s[i] == '0' or s[i] == '1':
    ans = ans + s[i]
  elif s[i] == 'B' and len(ans) > 0:
    ans = ans[:-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 ans==[]:
    continue
  else:
    ans.pop()
for j in range(len(ans)):
  print(ans[j],end='')

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

for c in s:
  if c == 'B':
    if x:
      x.pop()
  else:
    x.append(c)
    
answer = ''.join(x)
print(answer)

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

if __name__=='__main__':
    main()

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.count('0') == 0 and ans.count('1') == 0:
        continue
    else:
        ans.pop()

print(''.join(ans))

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

Solution (Python):
s = input()

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

print(ans)

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

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

print("".join(ls))

Solution (Python):
s = input()

stack = []
for _s in s:
    if _s == "0":
        stack.append("0")
    elif _s == "1":
        stack.append("1")
    else:
        if len(stack) > 0:
            stack.pop(len(stack)-1)

res = ""
for s in stack:
    res += s
print(res)

Solution (Python):
s = input()

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

Solution (Python):
s = input()

t = ""

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

Solution (Python):
str = input()

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

print(ans)

Solution (Python):
s = input().strip()
ans = ""
for s_i in s:
  if s_i == "1":
    ans += "1"
  elif s_i == "0":
    ans += "0"
  else:
    if len(ans)>0:
      ans = ans[:-1]
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 != []:
            ans.pop()

print("".join(ans))

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

list = []

for i in range(len(l)):
    if l[i] == 'B':
        if not list:
            continue
        else:
            del list[-1]
    else:
        list.append(l[i])

print(''.join(list))

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

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

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

Solution (Python):
s=list(input())
t=[]
for i in range(len(s)):
    if(s[i]=="0"):
        t = t +["0"]
    if(s[i]=="1"):
        t = t +["1"]
    if(s[i]=="B"):
        if(len(t)>0):
            t = t[:-1]
    
a="".join(t)
print(a)

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

for i in range(0, len(s)):
    if s[i] == 'B' and len(s_l) > 0:
        s_l.pop()
    elif s[i] != 'B':
        s_l.append(s[i])
        
print(''.join(s_l))

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

Solution (Python):

s = input()

display = ""
for i in s:
	if display != "" and i == "B":
		display = display[:-1]
	elif i == "1" or i == "0":
		display += i

print(display)

Solution (Python):
s = input()

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

Solution (Python):
a=input()
b=""

for i in a:
    if i=="0":
        b+="0"
    if i=="1":
        b+="1"
    if i=="B":
        b=b[:-1]

print(b)

Solution (Python):
s = list(input())
size = len(s)
ans = []
for i in range(size) :
    if len(ans) >= 1 :
        if s[i] ==  "B" :
            ans.pop(-1)
        else : ans.append(s[i])

    elif s[i] != "B" : ans.append(s[i])

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

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

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

ans = []

for i in s:
    if i == "0":
        ans.append("0")
    elif i == "1":
        ans.append("1")
    else:
        try:
            x = ans.pop()
        except:
            pass

print("".join(ans))

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

answer=[]

for i in n:
    if i=="0":
        answer.append("0")

    elif i=="1":
        answer.append("1")

    elif i=="B":
        if len(answer):
            answer.pop()

print("".join(answer))

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

out = []
for i in range(len(s)):
    if s[i] == '0' or s[i] == '1':
        out.append(s[i])
    else:
        if len(out) > 0:
            out.pop(-1)
print("".join(out))

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

answer=[]

for i in range(len(x)):
    if x[i]=="0":
        answer.append("0")

    elif x[i]=="1":
        answer.append("1")

    elif x[i]=="B":
        if len(answer):
            answer.pop()

        else:
            pass

print("".join(answer))

Solution (Python):
s=input()
ans=[]
while len(s)!=0:
    if s[0] in ('0','1'):
        ans.append(s[0])
    elif s[0] == 'B' and len(ans)!=0:
        ans.pop()
    s=s[1:]
print(''.join(ans))

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

Solution (Python):
d = []
for s in input():
    if s == 'B' and len(d) == 0:
        continue
    elif s == 'B':
        d.pop()
    else:
        d.append(s)

print(*d, sep='')

Solution (Python):
s = input()
a = []
for w in s:
    if w == '0':
        a.append('0')
    elif w == '1':
        a.append('1')
    else:
        if len(a):
            a.pop()

print(''.join(a))

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

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

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

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

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

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

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

for i in s:
    if i == "0" or i == "1":
        s_list.append(i)
    else:
        if len(s_list) > 0:
            del s_list[-1]

print("".join(s_list))

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

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

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

Solution (Python):
s = input().strip()
v = ''
for c in s:
    if c in ('0', '1'):
        v += c
    else:
        v = '' if v == '' else v[:-1]

print(v)

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 len(ans) != 0:
        ans.pop(-1)
print(''.join(ans))

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

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

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

Solution (Python):
s = input()
edit = list()
for i in s:
    if i !="B":
        edit.append(i)
    else:
        if len(edit)!=0:
            edit.pop()
        else:
            continue
print(*edit,sep="")

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

answer = []
for char in a :
    if char == "B" :
        if len(answer) != 0 :
            answer.pop(-1)
    else :
        answer.append(char)

print(''.join(answer))

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

L = list(input().rstrip())
ans = []
for n in L:
    if n == "B":
        try:
            ans.pop()
        except:
            continue
    else:
        ans.append(n)
print(''.join(ans))

Solution (Python):
import itertools
S = input()
S = list(S)
ans = []
for s in S:
    if s == "B":
        if len(ans) > 0:
            ans.pop(len(ans) -1 )
    else:
        ans.append(s)
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'
    elif s[i]=='B':
        ans=ans[:-1]
print(ans)

Solution (Python):
s = input()

ans = ''

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

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

Solution (Python):
a = str(input())
s = len(a)
x = ""
while True:
    if s == 0:
        break
    elif a[0] == "0":
        x += "0"
    elif a[0] == "1":
        x += "1"
    elif a[0] == "B":
        x = x[:-1]
    s = s - 1
    a = a[1:]
print(x)

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

Solution (Python):
s=str(input())
for i in range(10):
    s=s.replace("0B","")
    s=s.replace("1B","")
s=s.replace("B","")
print(s)

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

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

output = []

for i in a:
  if (i == '0') or (i == '1'):
    output.append(i)
  elif (i == 'B') and (output != []):
    output.pop()
    
print(''.join(output))

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

for i in s:
    if i == "B" and ans != "":
        ans = ans[:-1]
    if i != "B":
        ans += i
print(ans)

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

Solution (Python):
S = input()

Answer = ''

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

Solution (Python):
s = input()
d = []
for i in range(len(s)):
    if s[i] == '0' or s[i] == '1':
        d.append(s[i])
    elif s[i] == 'B':
        if d != []:
            d.pop()
print(''.join(d))

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

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