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()
L = []
for c in S:
  if c == "0":
    L.append(c)
  elif c == "1":
    L.append(c)
  else:
    if len(L) > 0:
      L.pop()
r = "".join(L)
print(r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

t = ""
for i in range(len(S)):
  if S[i] == "B":
    if t != "":
      t = t[:-1]
  else:
    t += S[i]
print (t)

Submission status: Accepted

Solution code:
s=input()

out=[]
for c in list(s):
  if c=='0':
    out.append('0')
  elif c=='1':
    out.append('1')
  else:
    if len(out)>0:
      del out[-1]
print(''.join(out))

Submission status: Accepted

Solution code:
def B_UnhappyHacking():
    S = input()
    ans = []
    for s in S:
        if "B" == s:
            ans = ans[:-1]
        else:
            ans.append(s)
    print(*ans,sep="")
    
if __name__ == "__main__":
    B_UnhappyHacking()

Submission status: Accepted

Solution code:
s = list(input())
#key =s.copy()
#print(s)
a = []
#count = 0

for i in s:
 # print(s)
  if i == 'B':
    a = a[:-1]
    #del a[-1]
  else:
    a.append(i)
  
    
print(''.join(a))

Submission status: Accepted

Solution code:
s = list(input())
#key =s.copy()
#print(s)
a = []
#count = 0

for i in s:
 # print(s)
  if i == 'B' and s.index(i) == 0:
    a = a[:-1]
  elif i == 'B':
    a = a[:-1]
    #del a[-1]
  else:
    a.append(i)
  
    
print(''.join(a))

Submission status: Accepted

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

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:
arr=[]
s = input()

for i in  s:
  if i == '0':
    arr.append('0')
  elif i == '1':
    arr.append('1')
  elif i == 'B':
    if len(arr) > 0:
      arr.pop(-1)
  else:
    pass
  
print(''.join(arr))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
answer = []
cursor = 0


for i in range(len(s)):
  if s[i] == "0" or s[i] == "1":
    #print(s[i])
    answer.append(s[i])
    cursor += 1
  elif cursor > 0:
    del answer[-1]
    cursor -= 1
for i in range(cursor):
  print(answer[i], end = "")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

rslt = []
for c in s:
  if c in ['0', '1']:
    rslt.append(c)
  elif rslt:
    rslt = rslt[:-1]
print(''.join(rslt))

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
ans = []
for i in range(n):
  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()
syamu = []

length = len(s)

for i in range(length):
	if s[i] == 'B':
		if len(syamu) > 0:
			syamu.pop()
	else:
		syamu.append(s[i])

print("".join(syamu))

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')
    else:
        if ans==[]:
            continue
        else:
            ans.pop(-1)
print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-                                                                                     
s = input()
a = []

for c in s:
    if c == '1' or c == '0':
        a.append(c)
    else:
        if len(a) > 0:
            a.pop(-1)

print(''.join(a))

Submission status: Accepted

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

s = input()
n = len(s)
s_list = []

for i in range(0, n):
    if s[i] == 'B':
        if len(s_list) == 0:
            continue
        else:
            s_list.pop(-1)
    else:
        s_list.append(s[i])

S = ''
for i in range(0, len(s_list)):
    S = S + s_list[i]

print(S)

Submission status: Accepted

Solution code:

# -*- coding:utf-8 -*-                                                                                     
import numpy as np
import scipy as sp

s = input()
n = len(s)
s_list = []

for i in range(0, n):
    if s[i] == 'B':
        if len(s_list) == 0:
            continue
        else:
            s_list.pop(-1)
    else:
        s_list.append(s[i])

S = ''
for i in range(0, len(s_list)):
    S = S + s_list[i]

print(S)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
a = []
#n=[s[i] for i in range(len(s))]

for i in range(len(s)): 
    if len(a)>0 and s[i]=="B":
        a.pop(-1)
    elif s[i]=='0':
        a.append('0')
    elif s[i]=='1':
        a.append('1')
answer=""
for i in range(len(a)):
    answer += a[i]

print(answer)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 文字列の入力
S = input()
T = ''
for i in range(len(S)):
	if S[i] == '0':
		T += '0'
	elif S[i] == '1':
		T += '1'
	elif S[i] == 'B':
		T = T[:-1]
print(T)

Submission status: Accepted

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

print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
while ("0B" in s)==True:
    s=s.replace("0B","")
while ("1B" in s)==True:
    s=s.replace("1B","")
while ("B" in s)==True:
    s=s.replace("B","")
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

t = ""
for i in range(len(S)):
  if S[i] == "B":
    if t != "":
      t = t[:-1]
  else:
    t += S[i]
print (t)

Submission status: Accepted

Solution code:
#Bとその前１文字を消せば良い
s =list(input())
lis = []
for i in range(len(s)):
    if s[i] == "B":
        if len(lis) >0:
            lis.pop()
    else: lis.append(s[i])
print("".join(lis))

Submission status: Accepted

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

Submission status: Accepted

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


print(str)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nyu=input()
shutu=[]
for i in nyu:
	if i=="B":
		if len(shutu)!=0:
			shutu.pop(-1)
	else:
		shutu.append(i)
kekka="".join(shutu)
print(kekka)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
ans = []
for x in s:
    if x == 'B' and len(ans):
        ans.pop()
    elif x == 'B' and len(ans) == 0:
        pass
    else:
        ans.append(x)
ans_s = ''
for x in ans:
    ans_s += x
print(ans_s)

Submission status: Accepted

Solution code:
S = list(raw_input())
ans = ""
for i in range(0,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()

while "B" in s:
    if s[0] == "B":
        s = s[1:len(s)+1]
    s = s.replace("0B", "")
    s = s.replace("1B", "")

print(s)

Submission status: Accepted

Solution code:
a = []
for c in input():
    if c in '01':
        a.append(c)
    else:
        a = a[:-1]
print("".join(a))

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = list(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:
s_list = list(input())
ans = []
for s in s_list:
    if s=='0':
        ans.append(0)
    elif s=='1':
        ans.append(1)
    if s=='B':
        if len(ans)>0:
            del ans[-1]
print(''.join(map(str,ans)))

Submission status: Accepted

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

print(editor)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
strs = input()

ans = ''
for s in strs :
	if s == '0' or s == '1':
		ans += s
	elif s == 'B':
		if len(ans) > 0:
			ans = ans[:-1]
print( ans )

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC 43, B - unhappy hacking
s = input()

text = ''
for i in s:
    if i == '1':
        text += '1'
    elif i == '0':
        text += '0'
    elif i == 'B' and text:
        text = text[:-1]
print(text)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(s: str):
    ret = ''
    for c in s:
        if c == 'B':
            if len(ret) > 0:
                ret = ret[:-1]
        else:
            ret += c
    print(ret)
    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:
s=input()
s_list=list(s)

string=[]

for i, x in enumerate(s_list):
    if x=='0':
        string.append('0')
    if x=='1':
        string.append('1')
    if x=='B':
        if len(string) != 0 :
            string.pop()
        else: pass
        
string_out=''.join(string)

print(string_out)

Submission status: Accepted

Solution code:
s=input()


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

mojiretu = ' '
 
for x in result:
    mojiretu += x
    
print(mojiretu)

Submission status: Accepted

Solution code:

import sys


def main():
    data = list(input())
    ans = []
    for ele in data:
        if ele == 'B' and len(ans) > 0:
            ans.pop(-1)
        elif ele == '1':
            ans.append('1')
        elif ele == '0':
            ans.append('0')
        # print(ans)

    print(''.join(ans))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC043B

s = input()
l = len(s)
result = ""
for i in range(l):
    if s[i]!="B":
        result +=s[i]
    else: result =result[:-1]

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
d = 0
m = []
for i in s[::-1]:
    if i == 'B':
        d += 1
    elif d > 0:
        d -= 1
    else:
        m.append(i)

for i in m[::-1]:
    print(i, end='')

Submission status: Accepted

Solution code:
lst=""
i=list(input())
for j in i:
    if j=="0"or j=="1":
        lst+=j
    elif j=="B"and lst!=[]:
        lst=lst[:-1]
print(lst)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(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 = str(input())
ans = ''
for char in s:
  if char == 'B':
    if len(ans) == 0:
      continue
    else:
      ans = ans[:-1]
  elif char == '0':
    ans = ans + '0'
  else:
    ans = ans + '1'
print(ans)

Submission status: Accepted

Solution code:
def main():
    s = input()
    ans = []
    for op in s:
        if op == '0':
            ans.append(op)
        elif op == '1':
            ans.append(op)
        else:
            if len(ans) > 0:
                ans.pop()
    print(*ans, sep='')
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S=input()
stream=""
for s in S:
    if s=="0": stream+="0"
    elif s=="1": stream+="1"
    elif s=="B": stream=stream[:-1]
print(*stream, sep="")

Submission status: Accepted

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

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

for i in range(len(t)):
    print(t[i],end="")

Submission status: Accepted

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

print("{}".format(ans))

Submission status: Accepted

Solution code:
a = input()
ans = ""
for c in a:
  if (c == '0') | (c == '1'):
    ans += c
  else:
    if not ans == "":
      ans = ans[:len(ans)-1]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for i in s:
  if i=="B":
    if z:
      z.pop()
  else:
    z.append(i)

print("".join(z))

Submission status: Accepted

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

for i in s:
  if i=="0" or i=="1":
    z.append(i)
  elif i=="B" and len(z)!=0:
    z.pop()
else:
  print("".join(z))

Submission status: Accepted

Solution code:
a=''
for s in input():
  if s!='B':
    a+=s
  else:
    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"
  else:
    if ans != "":
      ans = ans[:len(ans) - 1]
print(ans)

Submission status: Accepted

Solution code:
#ABC043b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
lst = list(input())
st = ''
for i in lst:
  if i != 'B':
    st += i
  elif st != '' and i == 'B':
    st = st[:len(st) - 1]

print(st)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

ans = ""

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

print(ans)

Submission status: Accepted

Solution code:
s = [i for i in input()]
ans = []

for c in s:
    if c is '0' or c is '1': ans.append(c)
    else:
        try:
            ans.pop(-1)
        except: pass
print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(a)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a = II()
    ans = 0
    for i in range(a + 1):
        ans += i
    print(ans)
    return

#B
def B():
    s = S()
    ans = []
    for si in s:
        if si == "B":
            ans = ans[:-1]
            continue
        ans.append(si)
    print("".join(ans))
    return

#C
def C():
    return

#D
def D():
    return

#Solve
if __name__ == '__main__':
    B()

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 range(0, len(S)):
	if S[i] == 'B':
		if ans != '':
			ans = ans[:len(ans)-1]
	else:
		ans = ans + S[i]
print(ans)

Submission status: Accepted

Solution code:

S = input()


lis = []


for s in S:

    if s == "0":
        lis.append("0")

    elif s == "1":
        lis.append("1")

    elif len(lis) > 0:

        del lis[-1]


print ("".join(lis))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
str = ""

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

print(str)

Submission status: Accepted

Solution code:

s = [ n for n in input()]

ans = []

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

print("".join(ans))

Submission status: Accepted

Solution code:
import sys

def main():
    s = input()
    output = ''
    for i in s:
        if i == 'B':
            output = output[0:-1]
        else:
            output += i
    print(output)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

tmp = [0] * 10
num = 0
for i in range(len(s)):
    if s[i] == "0":
        tmp[num] = "0"
        num += 1
    elif s[i] == "1":
        tmp[num] = "1"
        num += 1
    else:
        num = max(0, num-1)

for i in range(num):
    print(tmp[i],end="")
print()

Submission status: Accepted

Solution code:
Key_in = list(input())

output = []
for key in Key_in:
    if key == '0':
        output.append('0')
    elif key == '1':
        output.append('1')
    elif key =='B':
        if len(output) != 0:
            output.pop()
        else:
            pass

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

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

for i in s:
    if i == 'B':
        if len(res) > 0:
            res = res[:-1]
    else:
        res += i

print(res)

Submission status: Accepted

Solution code:
from sys import stdin
s = (stdin.readline().rstrip())
ans = ""
for i in s:
    if i == "0":
        ans = ans + "0"
    elif i == "1":
        ans = ans + "1"
    elif i == "B" and len(ans) != 0:
        ans = ans[:-1]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()

ret = []
for s_ in s :
    if s_ == 'B' :
        if len(ret) != 0 :
            ret.pop()
    else :
        ret.append(s_)

print(''.join(ret))

Submission status: Accepted

Solution code:
s = list(str(input()))
sentence = []
ans = ''

for i in range(len(s)):
    if s[i] == '0':
        sentence.append(0)
    elif s[i] == '1':
        sentence.append(1)
    else:
        if sentence == []:
            continue
        else:
            sentence.pop(-1)

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

print(ans)

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:
    if len(ans) == 0:
      pass
    else:
      ans.pop()
print("".join(ans))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#ABC43 B

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()
t = ""
for i in s :
    if i=="0" :
        t+="0"
    elif i=="1" :
        t+="1"
    elif t=="" :
        pass
    else :
        t=t[:-1]
print(t)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

# SA, SB, SC = [list(sys.stdin.readline().rstrip()) for _ in range(3)]
# SA.reverse()
# SB.reverse()
# SC.reverse()
#
# turn = 'a'
# while True:
#     if turn == 'a':
#         if len(SA) == 0:
#             print('A')
#             exit()
#         turn = SA.pop()
#     elif turn == 'b':
#         if len(SB) == 0:
#             print('B')
#             exit()
#         turn = SB.pop()
#     elif turn == 'c':
#         if len(SC) == 0:
#             print('C')
#             exit()
#         turn = SC.pop()

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

ans = []
for c in S:
    if c == 'B':
        if ans:
            ans.pop()
    else:
        ans.append(c)

print(''.join(ans))

Submission status: Accepted

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

for c in lst:
    if c=='1':
        ans += '1'
    elif c=='0':
        ans += '0'
    elif c=='B' and len(ans)!=0:
        ans =  ans[:-1]
print(ans)

Submission status: Accepted

Solution code:
list = input()

ans = []
for i in list:
    if i=="B" and len(ans)!=0:
        ans.pop()
    elif i=="0" or i=="1":
        ans.append(i)
print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for s in a:
  if s=="0" or s=="1":
    b.append(s)
  elif s=="B" and len(b)!=0:
    b.pop()
else:
  print("".join(b))

Submission status: Accepted

Solution code:
s=input()

l=[]

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


print(*l,sep="")

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