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 = raw_input()

def type(l, letters):
    if l == '0' or l == '1':
        letters += l
    elif l == 'B':
        if len(letters) != 0:
            letters = letters[:-1]
    return letters

ans = ''
for l in s:
    ans = type(l, ans)

print ans

Solution (Python):


s = input()
ans = [''] * len(s)
point = 0
for word in s:
    if word == 'B':
        point = max(0, point - 1)
    else:
        ans[point] = word
        point += 1
print("".join(ans[:point]))

Solution (Python):
keyinputs = raw_input()
 
output = ''
for i in xrange(len(keyinputs)):
    keyinput = keyinputs[i]
    if keyinput == '1' or keyinput == '0':
        output+= keyinput
    elif keyinput == 'B':
        if not output == '': 
            output = output[:-1]
print output

Solution (Python):
from sys import stdin, stdout

s = stdin.read()
s = list(s)

display = []

for c in s:
    if c == 'B' and len(display) != 0:
        display.pop(-1)
    elif c == '1' or c == '0':
        display.append(c)

res = ''.join(display)

stdout.write(res)

Solution (Python):
s=raw_input()

output=""

for c in s:
    if c=='B' and len(output)==0:
        continue
    elif c=='B':
        output = output[:-1]
    elif c=='0':
        output += '0'
    elif c=='1':
        output += '1'

print output

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

Solution (Python):
s=raw_input()
a=""
for k in range(len(s)):
    if s[k]=="0":
        a=a+"0"
    elif s[k]=="1":
        a=a+"1"
    elif s[k]=="B":
        if len(a)>0:
            a=a[0:len(a)-1]
print a

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

Solution (Python):
r = input()

res = ''
for i in r:
    if i == '0':
        res += '0'
    elif i == '1':
        res += '1'
    elif i == 'B':
        res = res[:-1]

print(res)

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

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

Solution (Python):
s=list(reversed(input()))
ans=""
cnt=0
for c in s:
    if c == 'B':
        cnt += 1
    elif cnt > 0:
        cnt -= 1
    else:
        ans += c
print(''.join(reversed(ans)))

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

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

print(ans)

Solution (Python):
s = input()

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

Solution (Python):
N = raw_input()
con=""
for i in range(len(N)):
    if N[i]=="0" or N[i]=="1":
        con += N[i]
    elif N[i]=="B" and len(con) >= 1:
        con = con[:len(con)-1]
print con

Solution (Python):
s=input()

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

print(ans)

Solution (Python):
ret = ""
s = input().strip()
s = list(str(s))

for c in s:
    if c == "0":
        ret = ret + "0"
    elif c == "1":
        ret = ret + "1"
    else:
        if ret != "":
            ret = ret[:-1]
print(ret)

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

Solution (Python):
import re
def f(s):
    global a
    r = p.subn('',s)
    if r[1]!=0:
        return f(r[0])[0]
    else:
        a = r[0]
        return '0'
N = raw_input()
p = re.compile('\dB')
q = re.compile('^B*')
f(N)
print q.sub('',a)

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

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

Solution (Python):
s = raw_input()
mystr = ""
for x in s:
    if (x=='B'):
        mystr = mystr[0:len(mystr)-1]
    else: mystr += x
print mystr

Solution (Python):
s = list(raw_input())
t = []
for e in s:
    if e is "B":
        if t:
            t.pop()
    else:
        t.append(e)
print "".join(t) if t else ""

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

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

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

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

Solution (Python):
IN = list(raw_input())
OUT = []

while len(IN)>0 :
    if IN[0] == 'B':
        if len(OUT) > 0:
            OUT.pop()
    else:
        OUT.append(IN[0])

    IN.pop(0)

print ''.join(OUT)

Solution (Python):
stack = []
string = input().strip()
for s in string:
    if s == 'B':
        if stack:
            stack.pop()
    else:
        stack.append(s)
print(''.join(stack))

Solution (Python):
S = raw_input()

ans = ''
for t in S:
    if t == '0':
        ans += '0'
    elif t == '1':
        ans += '1'
    elif t == 'B':
        if ans:
            ans = ans[:-1]
            
print ans

Solution (Python):
import sys


in_str = list(raw_input())
out_str = ['X' for _ in range(10)]
cur_pos = 0

for x in in_str:
	if x != 'B':
		out_str[cur_pos] = x
		cur_pos = cur_pos + 1
	else:
		if cur_pos > 0:
			cur_pos = cur_pos - 1
		else:
			pass

print str(''.join(out_str[:cur_pos]))

Solution (Python):
I = input()

A =''

for n in I:
 if n == '0':
  A += '0'
 elif n == '1':
  A += '1'
 else:
  if len(A) > 0:
   A = A[:-1]


print(A)

Solution (Python):

import sys
     
list_n = raw_input()

output = ''

for n in list_n:
    if n == '0':
        output += '0'
    elif n == '1':
        output += '1'
    else:
        if len(output) > 0:
            output = output[:-1]

print output

Solution (Python):



l=list(raw_input())

res=""
for i in xrange(len(l)):
 if l[i]=='0':
  res=res+'0'
 elif l[i]=='1':
  res=res+'1'
 elif l[i]=='B':
  res=res[:-1]
  
print res

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

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

for k in S:
    if k == "0":
        ans += "0"
    elif k == "1":
        ans += "1"
    elif k == "B" and ans != "":
        ans = ans[:len(ans)-1]

print(ans)

Solution (Python):
a = input()
ans = ""
for i in a:
    if i == "0" or i == "1":
        ans += i
    
    elif len(ans) > 0 :
        ans = ans[:len(ans)-1]

print(ans)

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

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

Solution (Python):
y=raw_input()
a=[]
for i in y:
    if i=='1' or i=='0':
        a.append(i)
    else:
        if a==[]:
            continue
        else:
            del a[len(a)-1]
print ''.join(a)

Solution (Python):
import re
S = input()
if 'B' in S:
	A = re.split("01BB|10BB|11BB|00BB|0B|1B",S)
	A = "".join(A)
	if 'B' in A:
		C = re.split("01BB|10BB|11BB|00BB|0B|1B",A)
		C = "".join(C)
		C = C.split("B")
		print("".join(C))
	else:
		print(A)
else:
	print(S)

Solution (Python):
string = input()
result = []
j=0
for i in range(len(string)):
    if string[i]=='0':
        result.append('0')
    elif string[i]=='1':
        result.append('1')
    elif string[i]=='B' and len(result)>=1 and result[-1] in ['0','1']:
        del result[-1]
str_result="".join(result)
print(str_result)

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

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

for char in s:
    if char == "0":
        array.append("0")
    elif char == "1":
        array.append("1")
    else:
        if len(array) != 0:
            del array[-1]
        else:
            pass

print("".join(array))

Solution (Python):


def main():
    s = []
    l = list(raw_input())
    for c in l:
        if c == '0':
            s.append(c)  
        elif c == '1':
            s.append(c)
        elif c == 'B':
            if 0 < len(s):
                s.pop()
                
        else:
            pass
        
    print "".join(map(str,s))

if __name__ == '__main__':
    main()

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

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

for i in S:
    if i == '0' or i == '1':
        out.append(i)
    elif len(out) != 0:
        out.pop()

print("".join(out))

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

print("".join(ans))

Solution (Python):

command=raw_input()
final=[-1]*10
i=0
for var in command:
    if var=="0":
        final[i]="0"
        i+=1
    elif var=="1":
        final[i]="1"
        i+=1
    elif var=="B":
        if i!=0:        
            i-=1
print "".join(final[0:i])

Solution (Python):


keys = input().rstrip()
result = ""

for c in keys:
    if c == "0":
        result += "0"
    elif c == "1":
        result += "1"
    elif c == "B":
        l = len(result)
        if l > 0:
            result = result[:l-1]

print(result)

Solution (Python):


from collections import deque


s = input().strip()
answer = deque()

for c in s:
    if c == '0':
        answer.append('0')
    elif c == '1':
        answer.append('1')
    elif c == 'B':
        try:
            answer.pop()
        except IndexError:
            answer = deque()

for c in answer:
    print(c, end='')
print('')

Solution (Python):
def solve(S):
  result = ""
  for c in S:
    if c == 'B': result = ('' if len(result) == 0 else result[:-1])
    else: result = result + c
  return result

print(solve(input()))

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

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

Solution (Python):
from re import search, sub

def update(s):
    if (search(r'[01]B', s)):
        return update(sub(r'[01]B', '', s))
    else:
        return s.replace('B', '')


print(update(input()))

Solution (Python):
key = []
for i in list(input()):
    key.append(i)
result = ""
for j in key:
    if j == "0":
        result = result + "0"
    elif j == "1":
        result = result + "1"
    elif j == "B":
        result = result[:-1]
print(result)

Solution (Python):
n = raw_input()

result =""

for var in n:
    if var == "0":
        result = result + var
    elif var == "1":
        result = result +var
    elif var == "B":
        tmp = ""
        for s in range(0,len(result)-1):
            tmp = tmp + result[s]
        result = tmp
print result

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

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

print(ans)

Solution (Python):
import re
import doctest

class IO_for_Contest(object):
    @staticmethod
    def my_input():
        
        return input()

    @staticmethod
    def read_from_input():
        
        pass

    @staticmethod
    def read_line():
        return IO_for_Contest.my_input().strip()

    @staticmethod
    def read_int():
        return int(IO_for_Contest.my_input().strip())

    @staticmethod
    def read_n_int(n):
        return list(map( \
                int, \
                re.split('\s+', IO_for_Contest.my_input().strip())))[ : n]
def solve():
    l = []
    buf = IO_for_Contest.read_line()
    for x in buf:
        if x == 'B':
            if len(l) > 0:
                l.pop()
        else:
            l.append(x)
    print(''.join(l))

if __name__ == '__main__':
    
    solve()

Solution (Python):

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

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

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

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

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

print s

Solution (Python):
s = raw_input()
str = []
for c in s:
    if c is '0':
        str.append('0')
    elif c is '1':
        str.append('1')
    elif len(str)!=0:
        del str[-1]
        
print ''.join(str)

Solution (Python):
s = raw_input()
txt = ""
for x in s:
    if x == 'B':
        if len(txt) > 0:
            txt = txt[:-1]
    else:
        txt += x

print txt

Solution (Python):
s = raw_input()
res = ""
for c in s:
    if c=='0':
        res += '0'
    if c=='1':
        res += '1'
    if c=='B' and res:
        res = res[:-1]

print res

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