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()
output = ""
for i in s:
    if i == '0' or i == '1':
        output += i
    elif i == 'B':
        output = output[:-1]
print(output)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

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

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

    word = ''

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

    print(word)

    # word = []
    # 
    # for key in keylist:
    #     if key == 'B':
    #         if word:
    #             word.pop()
    #     else:
    #         word.append(key)
    # 
    # print(''.join(word))

if __name__ == "__main__":

    main()

Submission status: Accepted

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

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

    print(''.join(word))

if __name__ == "__main__":

    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()

ans = ''

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

print("".join(OUT))

Submission status: Accepted

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

Submission status: Accepted

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

print("".join(res))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

S = s()

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


abc()

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

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


s = str(input())

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

print("".join(ans))

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 = input()
ans = ""

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

print(ans)

Submission status: Accepted

Solution code:
s = input()

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

print(''.join(ans))

Submission status: Accepted

Solution code:
s = str(input())

while 'B' in s:
    if s[0] == 'B':
        s = s[1:]
    s = s.replace('0B', '')
    s = s.replace('1B', '')
print(s)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

Submission status: Accepted

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

for i in range(len(s)):
    if s[i] == '0':
        ans.append('0')
    if s[i] == '1':
        ans.append('1')
    if s[i] == 'B':
        if len(ans) != 0:
            ans.pop(-1)

print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

ans = []
for s in S:
    if s == "B":
        if len(ans) != 0:
            ans.pop()
    else:
        ans.append(s)
print("".join(ans))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(''.join(lis))

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

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 ans==[]:
    continue
  else:
    ans.pop()
for j in range(len(ans)):
  print(ans[j],end='')

Submission status: Accepted

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

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

Submission status: Accepted

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

if __name__=='__main__':
    main()

Submission status: Accepted

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

s = input()
ans = []
for i in s:
    if i == '0':
        ans.append('0')
    elif i == '1':
        ans.append('1')
    elif i == 'B' and ans.count('0') == 0 and ans.count('1') == 0:
        continue
    else:
        ans.pop()

print(''.join(ans))

Submission status: Accepted

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

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:
s = []
for x in input():
  if x == "B":
    if len(s) > 0:
      s.pop()
  else:
    s.append(x)
print("".join(s))

Submission status: Accepted

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

print("".join(ls))

Submission status: Accepted

Solution code:
s = input()

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

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

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

Submission status: Accepted

Solution code:
s = input()

t = ""

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

Submission status: Accepted

Solution code:
str = input()

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

print(ans)

Submission status: Accepted

Solution code:
s = input().strip()
ans = ""
for s_i in s:
  if s_i == "1":
    ans += "1"
  elif s_i == "0":
    ans += "0"
  else:
    if len(ans)>0:
      ans = ans[:-1]
print(ans)

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

print("".join(ans))

Submission status: Accepted

Solution code:
l = list(input())

list = []

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

print(''.join(list))

Submission status: Accepted

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

Submission status: Accepted

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

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:
s=list(input())
t=[]
for i in range(len(s)):
    if(s[i]=="0"):
        t = t +["0"]
    if(s[i]=="1"):
        t = t +["1"]
    if(s[i]=="B"):
        if(len(t)>0):
            t = t[:-1]
    
a="".join(t)
print(a)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

s = input()

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

print(display)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

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

print(b)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

ans = []

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

print("".join(ans))

Submission status: Accepted

Solution code:
n=list(input())

answer=[]

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

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

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

print("".join(answer))

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

Solution code:
x=list(input())

answer=[]

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

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

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

        else:
            pass

print("".join(answer))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(*d, sep='')

Submission status: Accepted

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

print(''.join(a))

Submission status: Accepted

Solution code:
s=list(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()
ans = []
for i in s:
    if i == "0":
        ans.append("0")
    elif i == "1":
        ans.append("1")
    else:
        ans = ans[:-1]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print("".join(s_list))

Submission status: Accepted

Solution code:
S = str(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

print(v)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(input())

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

print(''.join(answer))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

Submission status: Accepted

Solution code:
import itertools
S = input()
S = list(S)
ans = []
for s in S:
    if s == "B":
        if len(ans) > 0:
            ans.pop(len(ans) -1 )
    else:
        ans.append(s)
print("".join(ans))

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

ans = ''

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

output = []

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

Answer = ''

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ss = list(input())

screen = []
for s in ss:
    if s == 'B':
        if len(screen) == 0:
            pass
        else:
            screen.pop()
    else:
        screen.append(s)

print(''.join(screen))

Submission status: Accepted

Solution code:
S=input()
ans=[]
for i in range(len(S)):
  if S[i] in ["0","1"]:
    ans.append(S[i])
  elif len(ans) > 0:
    ans.pop(-1)
print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
display = []
for key in s:
  if key == "B":
    if display != []:
      del display[-1]
  else:
    display.append(key)
print("".join(display))

Submission status: Accepted

Solution code:
s=input()

k=""

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
temp = ""

in_keys = input().rstrip()

while(True):

    index = in_keys.find("B")
    if index == -1:
        break
    elif index == 0:
        temp = in_keys[1:]
    else:
        temp = in_keys[:index-1] + in_keys[index+1:]
        #print(in_keys[:index-1],in_keys[index+1:])

    in_keys = temp

print(in_keys)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
S = input()

result = ""
for c in S:
    if c == "0" or c == "1":
        result += c
    elif c == "B" and result != "":
        result = result[:-1]

print(result)

Submission status: Accepted

Solution code:
S = list(input())
l = 0
o = ['']*10
for s in S:
    if s == 'B':
        l = max(0,l-1)
    else:
        o[l] = s
        l += 1

print(''.join(o[0:l]))

Submission status: Accepted

Solution code:
s = input()

editer = ''
for character in s:
    if character != 'B':
        editer += character
    elif character == 'B' and editer:
        editer = editer[:-1]

print(editer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: UTF-8 -*-
s = input()
ans = ''
for c in s:
    if c == 'B':
      ans = ans[:-1]
    else:
      ans += c

print(ans)

Submission status: Accepted

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