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.



Sample input:
01B0


Sample output:
00

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
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))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
# coding: utf-8;

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# problem B

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))

Submission status: Accepted

Solution code:
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())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
s = input()

str = ""

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

print(str)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
#B
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))

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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("")

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
#!/usr/bin/env 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]))

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
s=input()

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

print(ans)

Submission status: Accepted

Solution code:
ret = ""
s = input().strip()
s = list(str(s))
#print(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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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 ""

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
import sys

#sys.stdin = open('b_2.txt', 'r')
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]))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# coding: utf-8
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

Submission status: Accepted

Solution code:
#coding: utf-8
#ABC043B

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:


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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:

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])

Submission status: Accepted

Solution code:
# coding: utf-8

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)

Submission status: Accepted

Solution code:
# coding: utf-8

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('')

Submission status: Accepted

Solution code:
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()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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()))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
import re
import doctest

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

    @staticmethod
    def read_from_input():
        #TODO: impl this for each problem
        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__':
    #doctest.testmod()
    solve()

Submission status: Accepted

Solution code:
#! /usr/bin/env python3
s = []
for i in input():
    if i == 'B':
        s = s[:-1]
    else:
        s += [i]
print("".join(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

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

print s

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

print txt

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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)

Submission status: Runtime Error

Solution code:
s = input()
ans = ""
for char in s:
    if char != 'B':
        ans += char
    else:
        if ans == "":
            pass
        else:
            len = len(ans)
            ans = ans[0:len - 1]
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
S = s.split('B')
for n in range(count):
    s_B = s.find('B')
    print( s[s_B-1:s_B+1])
    s = s[s_B-1:s_B+1]

Submission status: Runtime Error

Solution code:

opperations = list(input())
display_stack = []
for opperation in opperations:
    if opperation == "B":
        if display_stack:
            display_stack.pop()
    else:
        display_stack.append(opperation)
print(''.join(display_stack))
ß

Submission status: Runtime Error

Solution code:
a = list(input())
ans = []
for i in range(len(a)):
    if a[i] == '0':
        ans.append('0')
    elif a[i] == '1':
        ans.append('1')
    elif a[i] == 'B':
        if ans == []:
            continue
        else:
            i -= 1
            ans.remove(ans[i])
print(''.join(ans))