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

Solution (Python):
inst = input()
buf = []
for s in inst:
  if s == "B":
    if len(buf) != 0:
      del buf[-1]
  else:
    buf.append(s)
print("".join(buf))

Solution (Python):
import sys
import io


def run(input: io.TextIOBase, output: io.TextIOBase):
    x = input.readline().strip()
    r = ""
    for i in x:
        if i == "B":
            r = r[0:-1]
        else:
            r += i

    output.write(r + '\n')


if __name__ == '__main__':
    run(sys.stdin, sys.stdout)

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

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

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

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

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

Solution (Python):
S = [str(i) for i in input()]
stuckS = []
for i in range(len(S)):
    if S[i] == "B":
        if len(stuckS) == 0:
            continue
        else:
            stuckS.pop()
    else:
        stuckS.append(S[i])

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

Solution (Python):
S=input()

word="A"
word=word[:-1]
num=len(S)
for i in range(num):        
    if S[i]=="0":
        word+=str(0)
    elif S[i]=="1":
        word+=str(1)
    else:
        if len(word)!=0:
           word=word[:-1]
        else:
            word=word
    

print(word)

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

Solution (Python):
a = input()

ret = ""
cnt = 0
for i in a:
    if i == "B":
        ret = ret[:-1:]
    else:
        ret += i
print(ret)

Solution (Python):
keystrokes = input()
word = []
for k in keystrokes:
    if k == '0' or k == '1':
        word.append(k)
    elif word:
        word.pop()
print(''.join(word))

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

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

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

L = []

for i, ch in enumerate(S):
    if ch != 'B':
        L.append(ch)
    elif len(L) > 0:
        L = L[:-1]

print(''.join(L))

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

rst = []

for i in range(0,len(s)):
	if slist[i] == '0':
		rst[len(rst):] = slist[i]
	elif slist[i] == '1':
		rst[len(rst):] = slist[i]
	elif slist[i]== 'B':
		if len(rst) == 0:
			rst == []
		else:
			rst[len(rst)-1:len(rst)] = ''
		
	

jd = "".join(rst)
print(jd)

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

Solution (Python):
inp = list(input())
s = []
for i in inp:
    if i == "0":
        s.append(i)
    if i == "1":
        s.append(i)
    if i == "B":
        if s == []:
            continue
        s.pop(-1)
n = ','.join(s)
n = n.replace(",", "")
print(n)

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

Solution (Python):
import sys
S=list(input())
outp=""
for i in S:
    if(i=="0"):
        outp+="0"
    elif(i=="1"):
        outp+="1"
    else:
        if(len(outp)!=0):
            outp = outp[0:-1]
print(outp)

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

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

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

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

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


if __name__ == '__main__':
    main()

Solution (Python):
s=list(input())
  
T=[]
for i in s:
    if i=="B" and T!=[]:
        T.pop()
    elif i!="B":
        T.append(i)
Ts=""
for i in T:
    Ts+=i

print(Ts)

Solution (Python):

"""
https://beta.atcoder.jp/contests/abc043/tasks/abc043_b

"""
import sys
from sys import stdin
input = stdin.readline


def solve(s):
    ans = []

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


def main(args):
    s = input().strip()
    ans = solve(s)
    print(*ans, sep='')


if __name__ == '__main__':
    main(sys.argv[1:])

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

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

Solution (Python):
n = list(input())
ans = []
for i in range(0,len(n)):
    if n[i] == "0":
        ans.append("0")
    elif n[i] == "1":
        ans.append("1")
    else:
        ans = ans[:-1]
print("".join(ans))

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

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

for i in range(len(s)):
    if s[i] == "0":
      z += "0"
    elif s[i] == "1":
        z+= "1"
    elif s[i] == "B":
        z = z[:-1]

print (z)

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

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

print(ans)

Solution (Python):
s = input()
lst = []
for i in range(len(s)):
    if s[i] == "B":
        if lst:
            del lst[len(lst)-1]
    else:
        lst.append(s[i])

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

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

for i in s:
   if i == "0" or i =="1":
      a.append(i)
   elif i =="B" and a !=[]:
      a.pop(-1)
   elif i =="B" and a ==[]:
      continue

print(''.join(a))

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

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

for s in S:
    if (s == "B") & (len(ans) != 0):
        del ans[-1]
    elif s == "1":
        ans.append("1")
    elif s == "0":
        ans.append("0")

print("".join(ans))

Solution (Python):

cmd = input()
now = ""

for c in cmd:
    if c == 'B':
        now = now[:-1]
    else:
        now = now + c

print(now)

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

Solution (Python):
s=list(input())
total=[]
for i in range(len(s)):
    if s[i]=="0":
        total.append(0)
    if s[i]=="1":
        total.append(1)
    if s[i]=="B":
        if len(total)==0:
            continue
        else:
            total.pop()
total_i=""
for i in range(len(total)):
    total_i+=str(total[i])
print(total_i)

Solution (Python):
s=input()
for _ in [0]*4:
    s=s.replace("1B","")
    s=s.replace("0B","")
print(s.strip("B"))

Solution (Python):

if __name__ == '__main__':

    s = input()
    
    ans = []
    for i in s :
        if i == 'B' :
            if len(ans) > 0 :
                ans.pop()
        else:
            ans.append(i)
    
    for i in ans :
        print(i, end="")

    print()

Solution (Python):
S = input()
s = ['' for c in S]
i = 0
for c in S:
  if c == '0' or c == '1':
    s[i] = c
    i += 1
  else:
    if i > 0:
      i -= 1
      s[i]=''
print(''.join(s))

Solution (Python):
s=raw_input()
a=[]
for i in s:
	if i!="B":
		a.append(i)
	else:
		if len(a)!=0:
			a.pop(-1)

print ''.join(a)

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:
			continue
		
		else:
			del Ans[-1]
		
a = ''.join(Ans)

print(a)

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

Solution (Python):
def main():
    S = list(input())
    
    A = []
    for s in S:
        if s == "B":
            if len(A) == 0:
                pass
            else:
                A.pop()
        elif s == "0":
            A.append("0")
        elif s == "1":
            A.append("1")
    
    if len(A) == 0:
        print("")
    else:
        for x in range(len(A)):
            if x != len(A) - 1:
                print(A[x], end = "")
            else:
                print(A[x])


if __name__ == "__main__":
    main()

Solution (Python):
words = raw_input()
inlis = list(words)
outlis = []
for item in inlis:
	if item == "0" or item == "1":
		outlis.append(item)
	elif item == "B":
		if outlis:
			outlis.pop(len(outlis)-1)
print "".join(outlis)

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

for i in s:
  if i == "0":
    li.append('0')
  elif i == "1":
    li.append('1')
  elif i == "B" and not len(li) == 0:
    li.pop(-1)

print("".join(li))

Solution (Python):
s = input()

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

Solution (Python):
a=[]
for c in input():
	if"B"==c:a==[]or a.pop()
	else:a+=c,
print(''.join(a))

Solution (Python):
a=[]
for c in input():
 if"B"==c:a==[]or a.pop()
 else:a+=c,
print(''.join(a))

Solution (Python):
a=[]
for c in input():
 if"B"==c:a==[]or a.pop()
 else:a+=c,
print(''.join(a))

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

Solution (Python):

import math
import sys
import itertools
import numpy as np
import functools
import collections
mo = 1000000007
INF = 10**100
r = range

class infix(object):
    def __init__(self, function):
        self.function = function

    def __ror__(self, other):
        self.left = other
        return self

    def __or__(self, other):
        return self.function(self.left, other)

    def __call__(self, value1, value2):
        return self.function(value1, value2)

@infix
def c(f_t_u, f_u_r): return lambda t: f_u_r(f_t_u(t))

class _Ap(object):
    def __rlshift__(self, other):
        self.value = other
        return self

    def __rshift__(self, other):
        return other(self.value)
Ap = _Ap()
ap = Ap




s=input()
ret=[]
for c in s:
    if c == '0':
        ret.append('0')
    elif c == '1':
        ret.append('1')
    else:
        if ret<<ap>>len:
            ret.pop();

print(''.join(ret));

Solution (Python):



"""043-b"""


import sys


def main():
    """Main function."""
    s = input()

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

    print(res)


if __name__ == '__main__':
    sys.exit(main())

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

Solution (Python):
s = input()
res = ""
for w in s:
  if w == '0':
    res += "0"
  elif w == '1':
    res += "1"
  elif w == 'B' and len(res) != 0:
    res = res[:len(res)-1]

print(res)

Solution (Python):
s = input()

a = ''

for i in range(len(s)):
    if s[i] == 'B':
        a = a[:-1]
    else:
        a += s[i]

print(a)

Solution (Python):





def main():
    S = input()

    T = ""
    for c in S:
        if c == "B":
            T = T[:-1]
        else:
            T += c

    print(T)

if __name__ == "__main__": main()

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

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 = input()
array = []
for w in S:
    if w == "B" and len(array):
        array.pop()
    elif w != "B":
        array.append(w)
for w in array:
    print(w, end="")
print()

Solution (Python):





str =""
for i in input():
    if i is '0':
        str+="0"
    elif i =='1':
        str+="1"
    else:
        str = str[:-1]
print(str)

Solution (Python):
a = raw_input()
ans = ''
for x in a:
	if x == '0':
		ans += '0'
	if x == '1':
		ans += '1'
	if x == 'B':
		if ans != '':
			ans = ans [:-1]
print(ans)

Solution (Python):
from collections import deque
s = str(input())
b = deque()

for i in range(len(s)):
    if s[i] == "0":
        b.append("0")
    elif s[i] == "1":
        b.append("1")
    elif s[i] == "B":
        if len(b) == 0:
            pass
        else:
            b.pop()


print("".join(map(str, b)))

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

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

N=len(s)

L=[]

for i in range(N):
    if s[i]=='0':
        L.append('0')
    elif s[i]=='1':
        L.append('1')
    elif s[i]=='B':
        if L==[]:
            pass
        else:
            del L[-1]

A=''.join(L)
print(A)

Solution (Python):
s = list(input())
L = []
for i in s:
  if i != "B":
    L.append(i)
  else:
    if len(L) >= 1:
      L.pop()
    else:
      pass
print(''.join(L))

Solution (Python):
S = list(raw_input())
result = []
for s in S:
	if s == "0":
		result.append(0)
	elif s == "1":
		result.append(1)
	elif s == "B":
		if len(result) != 0:
			result.pop(len(result)-1)
txt = ""
for r in result:
	txt += str(r)
print txt

Solution (Python):
from collections import defaultdict


def main():
    s = input()
    ans = ""
    for c in s:
        if c in ["0", "1"]:
            ans += c
        elif c == "B" and len(ans) > 0:
            ans = ans[:len(ans) - 1]
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
S = input()

ans = ""

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

Solution (Python):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))

s = rls()
ans = ["" for i in s]
idx = 0
for i in s:
    if(i == "B"):
        idx -= 1
        if(idx == -1):
            idx += 1
        else:
            ans[idx] = ""
    else:
        ans[idx] = i
        idx += 1
print(pli(ans))

Solution (Python):


stack = []
for i in input():
    if i=='0':
        stack.append(0)
    elif i=='1':
        stack.append(1)
    else:
        if(len(stack)>0):
            stack.pop()

[print(s, end='') for s in stack]
print()

Solution (Python):
s = input()
output = []
for i in range(len(s)):
    if s[i] != 'B':
        output.append(s[i])
    else:
        if '0' in output or '1' in output:
            del output[-1]
cout = ''
for x in output:
    cout += x
print(cout)

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

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

result = []

for s in S:
    if s in ("0", "1"):
        result.append(s)
    elif result:
        result.pop()

print("".join(result))

Solution (Python):
s = input()
sl=[]
for i in s:
    if i == "0":
        sl.append("0")
    if i == "1":
        sl.append("1")
    if i == "B":
        if sl == []:
            continue
        else:
            sl.pop()
for i in sl:
    print(i, end = "")

Solution (Python):
s = raw_input()
chars = []
for c in s:
    if c == 'B' :
        if len(chars) > 0: chars.pop()
    else:
        chars.append(c)
print ''.join(chars)

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

    ans = []
    for s in S:
        if s == 'B':
            try:
                ans.pop()
            except:
                pass
        else:
            ans.append(s)

    print(''.join(ans))

main()

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

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

Solution (Python):


def list_n():
    return [int(e) for e in input().split()]


def list_s():
    return [s for e in input().split()]


def main(s):
    ret = []
    for c in s:
        if c in ['0', '1']:
            ret.append(c)
        else:
            if ret:
                ret.pop()
    return ''.join(ret)


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

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

Solution (Python):
S = list(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):
      del a[-1]

kotae = ""

for i in range(len(a)):
  kotae += a[i]

print(kotae)

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

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

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

print(ans)

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

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

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

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

Solution (Python):
import sys

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def solve():
    s = input()
    stack = []

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

    print(''.join(stack))


if __name__ == '__main__':
    solve()

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

Solution (Python):


def main():
    
    str=input()
    ans=""
    for c in str:
        if(c=='B' and ans!=""):
            ans=ans[:-1]
        elif(c!='B'):
            ans+=c
    print(ans)
            

if __name__=="__main__":
    main()

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

Solution (Python):

s = list(input())
ans = []
for tmp in range (len(s)):
    if s[tmp] == '0' or s[tmp] == '1':
        ans.append(s[tmp])
    elif len(ans) > 0:
        ans.pop()
print(''.join(ans))

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

Solution (Python):
s = raw_input()
x = []
for i in s:
    if len(x) > 0:
        if i == '0':
            x.append('0')
        elif i == '1':
            x.append('1')
        elif i == 'B':
            x.pop()
    else:
        if i == '0':
            x.append('0')
        elif i == '1':
            x.append('1')

print ''.join(x)

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

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

Solution (Python):


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

    for i, c in enumerate(s):
        if c == '1' or c == '0':
            ans += c
        elif i > 0:
            ans = ans[:-1]

    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
s = list(input())
ans= []
for c in s:
	if c == 'B':
		if ans != []:
			ans.pop()
		else:
			continue
	else:
		ans.append(c)
print(*ans,sep='')

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

Solution (Python):



s = list(input())
l = []
for i in s:
    if i == "0" or i == "1":
        l.append(i)
    elif len(l) > 0:
        l.pop()
    else:
        pass
print("".join(l))

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

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


def main():
    s = input()
    r = ''
    for c in s:
        if c == 'B':
            r = r[:-1]
        else:
            r += c
    return r



print(main())

Solution (Python):
S = raw_input()
w = ""
for c in S:
    if c == "B":
        if len(w) > 0:
            w = w[:-1]
    else:
        w += c
print w

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

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

print(ans)

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

if __name__ == '__main__':
    main()

Solution (Python):
s = input()

str = ""

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

print(str)

Solution (Python):
S=list(str(raw_input()))
res=[]
for i in  S:
    if(i=="B"):
        if(len(res)>0):
            res.pop()
    else:
        res.append(i)
print ''.join(res)

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

if __name__ == '__main__':
    main()

Solution (Python):
s = input()
ans = []
for si in s:
    if si == "0":
        ans.append('0')
    elif si == "1":
        ans.append('1')
    elif si == 'B' and len(ans):
        ans.pop()
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 = raw_input()

str_list = list(s)
output_list = []
for i, c in enumerate(str_list):
    if c != 'B':
        output_list.append(c)
    else:
        if output_list:
            output_list.pop()

print ''.join(output_list)

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

Solution (Python):
data = str(input())
res = []
for char in data:
    if char == '0':
        res.append('0')
    elif char == '1':
        res.append('1')
    else:
        try:
            res.pop()
        except:
            continue
print("".join(res))

Solution (Python):

S = input()
ans = []
for s in S:
    if s =='B' and len(ans)>0:
        del ans[-1]
    elif s == '1' or s == '0':
        ans.append(s)
print("".join(ans))

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

Solution (Python):

import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

s = raw_input()
ans = ""
for si in s:
    if si == "B":
        ans = ans[:-1]
    else:
        ans += si
print ans

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

for c in s:
    if c == "0" or c == "1":
        ans += c
    elif c == "B" and len(ans) > 0:
        ans = ans[:-1]

print(ans)

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

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

Solution (Python):
def read():
    return int(input())

def reads(sep=None):
    return list(map(int, input().split(sep)))

def main():
    s = input()
    a = []
    for c in s:
        if c == 'B':
            if a:
                a.pop()
        else:
            a.append(c)
    print(''.join(a))

main()

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

Solution (Python):
S = input()
R = list()
for x in S:
	if x == "B" and len(R) != 0:
		R.pop()
	elif x == "0" or x == "1":
		R.append(x)
print("".join(R))

Solution (Python):
s = input()
i = 0

ans = ['0']*(len(s))

for c in s:
	if c == '0':
		ans[i] = '0'
		i += 1
	elif c == '1':
		ans[i] = '1'
		i += 1
	elif c == 'B':
		if i > 0:
			i -= 1

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

Solution (Python):
result = []
key = input()
for i in key:
	if i == '0':
		result.append('0')
	elif i == '1':
		result.append('1')
	elif i == 'B':
		if result:
			result.pop()
print(''.join(result))

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

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

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

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

Solution (Python):

s = raw_input()
ret = []

for i in s:
    if i == 'B':
        if len(ret) != 0:
            ret.pop(len(ret)-1)
    else:
        ret.append(i)

print "".join(ret)

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

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

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

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

Solution (Python):
s=raw_input()
n=len(s)
ans=[]
for i in xrange(n):
    if s[i]=="B" and ans==[]:
        continue
    if s[i]=="B":
        del ans[-1]
    elif s[i]=="0":
        ans.append("0")
    else:
        ans.append("1")
print("".join(ans))

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


if __name__=="__main__":
    solve()

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

Solution (Python):
moji = []
s = raw_input()
for i in s:
    if i == '0':
        moji.append('0')
    if i == '1':
        moji.append('1')
    if i == 'B':
        if len(moji) != 0:
            moji.pop(len(moji)-1)
print ''.join(moji)