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

Submission status: Accepted

Solution code:
a = list(input())
s = []
for i in a:
    if i == 'B':
        if s == []:
            pass
        else:
            s.pop(-1)
    else:
        s.append(i)
print(''.join(s))

Submission status: Accepted

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




print(s)

Submission status: Accepted

Solution code:
set = input()
words = []
for i in range(len(set)):
    if set[i] == "0":
        words.append("0")
    if set[i] == "1":
        words.append("1")
    if set[i] == "B":
        try:
            words.pop(-1)
        except:
            pass
word = ""
for i in words:
    word += i
print(word)

Submission status: Accepted

Solution code:
s = input()

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

print(r)

Submission status: Accepted

Solution code:
import sys

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

def main():
    res = []
    for c in commands:
        if c == 'B':
            if res:
                res.pop()
        else:
            res.append(c)
    return ''.join(res)
            
if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

Solution code:
s = list(input())
ans = []
answer = ''
# print(s)
# print(type(s))
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:
            continue
        else:
            del ans[-1]

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

Submission status: Accepted

Solution code:
s = list(input())
ans = []
answer = ''
# print(s)
# print(type(s))
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:
            continue
        else:
            del ans[-1]

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

Submission status: Accepted

Solution code:
s=input()
ls=[]
for i in range(len(s)):
  if s[i]!="B":
    ls.append(s[i])
  elif ls!=[]:
    del ls[-1]
print(*ls,sep="")

Submission status: Accepted

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

Submission status: Accepted

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

def push_0(li):
    li.append(0)

def push_1(li):
    li.append(1)

def push_Back(li):
    if li == []:
        a = 1
    else:
        li.pop(-1)

for i in s:
    if i == '0':
        push_0(li)
    elif i == '1':
        push_1(li)
    else:
        push_Back(li)

for i in li:
    print(i, end='')

Submission status: Accepted

Solution code:
s=input()
ans=[]
for a in s:
    if a=='B':
        if ans==[]:
            continue
        else:
            ans=ans[0:-1]
    else:
        ans.append(a)
print(''.join(ans))

Submission status: Accepted

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

for a in s:
    if a == '0':
        ans.append('0')
    elif a == '1':
        ans.append('1')
    else:
        if ans != []:
            ans.pop(-1)

print(''.join(ans))

Submission status: Accepted

Solution code:
s = list(input())
ans = []
for i in range(0,len(s)):
    if s[i] == "B":
        if ans != []: ans.pop()
    else:
        ans.append(s[i])

print("".join(ans))

Submission status: Accepted

Solution code:
S = input()

S_2 = list(S)



ans = []

for i in range(len(S_2)):
    if S_2[i] == "0":
        ans.append("0")
    elif S_2[i] == "1":
        ans.append("1")
    elif S_2[i] == "B" and len(ans) !=0:
        del ans[-1]

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

Submission status: Accepted

Solution code:
# 空あり
# input: 0 or 1

# 入力
S = input()

result=[]
for i in range(len(S)):
    if S[i]=="0":
        result.append("0")
    elif S[i]=="1":
        result.append("1")
    elif S[i]=="B":
        if result != []:
            result.pop()
        
print("".join(result))

Submission status: Accepted

Solution code:
from collections import deque
s = deque(list(input()))
editor = deque()
while s:
  x = s.popleft()
  if x == "0":
    editor.append("0")
  elif x == "1":
    editor.append("1")
  elif x == "B" and len(editor) != 0:
    editor.pop()
print("".join(editor))

Submission status: Accepted

Solution code:
s = str(input())
s_list = list(map(str, s))
result = ""
for i in range(len(s_list)) :
  if s_list[i] == "1" or s_list[i] == "0" :
    result += s_list[i]
  else:
    result = result[:-1]
print(result)

Submission status: Accepted

Solution code:
S = input()

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

print(''.join(ans))

Submission status: Accepted

Solution code:
s = list(str(input()))
ln = []
for i in range(len(s)):
    if s[i] == '0':
        ln.append(s[i])
    if s[i] == '1':
        ln.append(s[i])
    if s[i] == 'B':
        if len(ln) != 0:
            ln.pop()
print(''.join(ln))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
a = [] 

for i in range(len(s)):
    if s[i] in '01':
        a.append(s[i])
    elif(len(a) > 0):
        a.pop(-1)
print(''.join(a))

Submission status: Accepted

Solution code:
s_list = list(input())
ans = []
for s in s_list:
  if s == '0' or s == '1':
    ans.append(s)
  elif s == 'B' and len(ans) > 0:
    ans.pop()

print(*ans, sep='')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
x=[]
for i in s:
    if i=='B':
        x=x[:-1]
    else:
        x.append(i)

print(''.join(x))

Submission status: Accepted

Solution code:
string = input()

answer = []

for c in string:
    if c == "B":
        if len(answer) != 0:
            answer.pop()
    else:
        answer.append(c)

print("".join(answer))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

S = list(input())

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

print(R)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
res = ''
for typed in s:
    if typed == '0':
        res = res + '0'
    elif typed == '1':
        res = res + '1'
    elif typed == 'B':
        if res != '':
            res = res[0:-1] #res[:-1] is equivalent
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

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

Submission status: Accepted

Solution code:
s = input()
ls = []

for mozi in s:
    if mozi == '0':
        ls.append(mozi)
    elif mozi == '1':
        ls.append(mozi)
    else:
        if len(ls) > 0:
            ls.pop()

ans = ''.join(ls)

print(ans)

Submission status: Accepted

Solution code:
S = input()
ans = ''
for i in S:
    if i == 'B' and len(ans) > 0:
        ans = ans[:-1]
    elif i != 'B':
        ans += i
print(ans)

Submission status: Accepted

Solution code:
a=input()
a_l=len(a)
ans=[]
moji=""
for i in range(a_l):
    if a[i]=="0":
        ans.append("0")
    elif a[i]=="1":
        ans.append("1")
    elif a[i]=="B" and len(ans)!=0:
        del ans[len(ans)-1]
    
for i in range(len(ans)):
    moji+=ans[i]
print(moji)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ans = ""

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

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(s: str):
    answer = ""
    for i in range(len(s)):
        if s[i] == 'B':
            if answer:
                answer = answer[:len(answer)-1]
        else:
            answer += s[i]
    print(answer)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    s = next(tokens)  # type: str
    solve(s)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin

s = stdin.readline().rstrip()

li = []

for i in s:
    if i == "0" or i == "1":
        li.append(i)
    else:
        if li:
            li.pop()

print("".join(li))

Submission status: Accepted

Solution code:

if __name__ == '__main__':
    INPUT=input()
    ans=[]
    for i in INPUT:
        if i=="0":
            ans.append("0")
        elif i=="1":
            ans.append("1")
        else:
            if len(ans)>0:
                ans.pop()
    print("".join(ans))

Submission status: Accepted

Solution code:
s = input()

ans = ''

check = 0

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

print(ans)

Submission status: Accepted

Solution code:
s=input()

a=''
for x in s:
  if x=='0':
    a+='0'
  elif x=='1':
    a+='1'
  else:
    # 文字列が空でない場合、末尾を削除
    if a!='':
      a=a[:-1]

# 出力
print(a)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
def editString(string, button):
    if button == 'B':
        if len(string) > 0:
            string = string[:-1]
        else :
            pass
    else :
        string += button
    return string

string = ''

buttons = input()

for button in buttons:
    string = editString(string, button)
    
print(string)

Submission status: Accepted

Solution code:
s = input()

ans = ""

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

Submission status: Accepted

Solution code:
s = list(input())
try:
    bs = s.index('B')
except:
    bs=-1

while bs != -1:
    if bs == 0:
        del s[bs]
    else:
        del s[bs-1]
        del s[bs-1]
    try:
        bs = s.index('B')
    except:
        bs = -1

print(''.join(s))

Submission status: Accepted

Solution code:
S=input()
l=[]
for s in S:
    if s=="0" or s=="1":
        l.append(s)
    else:
        if l==[]:
            pass
        else:
            del l[-1]
print("".join(l))

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"
  elif s[i] == "B":
    ans = ans[:-1]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

print(r)

Submission status: Accepted

Solution code:
s = raw_input()

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

for char in m:
    l.append(char)

k = []

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

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

print(result)

Submission status: Accepted

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

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

print("".join(ans))

Submission status: Accepted

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

print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())

lis = list(S)
t = ''

for u in lis:

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

Submission status: Accepted

Solution code:
# 043B
import sys

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(mpjiretsu)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
##### 解けた #####

S=input()
A=[""]

for s in S: # 入力の文字列1文字ずつ見てゆく
    if s in ["0","1"]: # もし0か1の場合、それを追加
        A.append(s)
    elif s=="B": # もしバックスペースの場合、1文字削除
        if len(A)>=1: # 長さが1以上の場合のみ削除
            A.pop(-1)

print("".join(A))

Submission status: Accepted

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

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

print(A)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect, fractions
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = []
count = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
from collections import deque

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

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

    print(''.join(ans))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

    print(''.join(ans))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

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

print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
import sys
sys.setrecursionlimit(10**8)
input = sys.stdin.readline

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

Submission status: Accepted

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

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

print(x)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

s = str(input())

ans = []

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

print("".join(ans))

Submission status: Accepted

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

print("".join(ans))

Submission status: Accepted

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


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

examB()

Submission status: Accepted

Solution code:
ks = list(input())

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict
input = sys.stdin.readline


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

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

print(t)

Submission status: Accepted

Solution code:
# ABC 043: B – バイナリハックイージー / Unhappy Hacking (ABC Edit)
s = input()
editor = ''

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

print(editor)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# python3 (3.4.3)
import sys
input = sys.stdin.readline

# main
S = input()

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

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

print(''.join(moji))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
s = input()
ans = ""
for i in range(len(s)):
    if s[i] == "0":
        ans += "0"
    elif s[i] == "1":
        ans += "1"
    else:
        if i !=  0:
            ans = ans[:-1]
        
print(ans)

Submission status: Accepted

Solution code:
from collections import deque

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#Unhappy Hacking (ABC Edit)
s = input()
r = ""
for i in range (0,len(s)):
    if s[i:i+1] == "0":
        r = r + '0'
    elif s[i:i+1] == "1":
        r = r + '1'
    else:
        if r != "":
            r = r[0:len(r)-1]
        else:
            pass
print(r)

Submission status: Accepted

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