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 i in s:
    if i == "0":
        ans.append(0)
    elif i == "1":
        ans.append(1)
    elif i =="B" and ans:
        ans.pop()
print(*ans,sep="")

Submission status: Accepted

Solution code:
from collections import deque
q = deque()

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

print("".join(q))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = list(input())

S = []
for i in s:
    if i == 'B':
        if S != []:
            S.pop(-1)
        else:
            pass
    else:
        S.append(i)
S_s = ''
for i in S:
    S_s += i
    
print(S_s)

Submission status: Accepted

Solution code:
t=[]
for i in input():
  if i=="B":
    try:t.pop()
    except:pass
  else:
    t.append(i)
print("".join(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:
keys = input()
r = ""
for k in keys:
  if k == "0":
    r += "0"
  elif k == "1":
    r += "1"
  elif k == "B":
    r = r[:len(r)-1]
print(r)

Submission status: Accepted

Solution code:
S = input()

d = []
for s in S:
    if s == "0":
        d.append("0")
    elif s == "1":
        d.append("1")
    else:
        if len(d) == 0:
            pass
        else:
            _ = d.pop(-1)

print("".join(d))

Submission status: Accepted

Solution code:
a = input()

ans = ''

for c in a:
    if c == '0' or c == '1':
        ans += c
    elif 'B':
        ans = ans[0:len(ans)-1]

print(ans)

Submission status: Accepted

Solution code:
C = []
A = input()
for i in A:
    if i == '0':
        C.append(i)
    if i == '1':
        C.append(i)
    if i == 'B' and  len(C)!=0:
        C.pop()
    else: pass

print("".join(C))

Submission status: Accepted

Solution code:
#B - バイナリハックイージー

# input s
s = input()

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

Submission status: Accepted

Solution code:
s=str(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:
        del ans[-1]
    else:
        pass
print("".join(map(str,ans)))

Submission status: Accepted

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

Submission status: Accepted

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

for i in s:
    if i == '0':
        now += '0'
    elif i == '1':
        now += '1'
    else:
        if len(now) == 0:
            continue
        else:
            now = now[:-1]
print(now)

Submission status: Accepted

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

for i in s:
    if i == '0':
        now.append(0)
    elif i == '1':
        now.append(1)
    else:
        if len(now) == 0:
            continue
        else:
            now.pop(-1)
for i in now:
    print(i, end="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
l = []
for t in s:
  if t == '0' or t == '1':
    l.append(t)
  elif t == 'B':
    if l != []:
      l.pop()
for r in l:
  print(r, end='')

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")
  elif ans and i == "B":
    del ans[-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:
    if len(s)>0:
      ans=ans[:-1]
print(ans)

Submission status: Accepted

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


def solve(s: str):
    z = ""
    for c in s:
        if c == "B":
            z = z[:-1]
        else:
            z += c
    print(z)


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()
ans = []

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

print(*ans, sep='')

Submission status: Accepted

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

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())
ans = []
for i in s:
    if i == "B" and ans:
        ans.pop()
    elif i == "B":
        pass
    else:
        ans.append(i)
print("".join(ans))

Submission status: Accepted

Solution code:
li = list(input())
ans = ''

for i in li:
    if i == '0':
        ans += '0'
    elif i == '1':
        ans += '1'
    else:
        ans = ans[0:-1]

print(ans)

Submission status: Accepted

Solution code:
given = [x for x in input()]
rets  = []
for i, v in  enumerate(given):
    if v in ["1", "0"]:
        rets += v
    elif v == "B" and len(rets) > 0:
        rets.pop()

print("".join(rets))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
for k in range(len(s)//2):
    s=s.replace("1B","").replace("0B","")
    if s==s.replace("1B","").replace("0B",""):
        break
s=s.replace("B","")
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
s=s[::-1]

b_cnt=0
ans=[]
for c in s:
    if c=="B":
        b_cnt+=1
    elif b_cnt==0:
        ans.append(c)
    else:
        b_cnt-=1
        if b_cnt <0:
            b_cnt=0
ans.reverse()

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

Submission status: Accepted

Solution code:
#ABC043

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - バイナリハックイージー

s = input()
ans = []

for key in s:
  if key == 'B':
    if len(ans) > 0:
      del ans[-1]
  else:
    ans.append(key)

print(''.join(ans))

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, floor
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

l = []
S = list(input())

for s in S:
    if s != "B":
        l.append(s)
    if s == "B" and len(l) != 0:
        l.pop()
    if s == "B" and len(l) == 0:
        continue
print("".join(l))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
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()
lis=[]
for i in range(len(s)):
    if s[i]=='0': lis.append('0')
    elif s[i]=='1': lis.append('1')
    elif s[i]=='B' and len(lis)==0: continue
    else: lis=lis[:-1]
print(''.join(lis))

Submission status: Accepted

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

for i in range(len(s)):
    if s[i]=="0":
        buf="".join((buf,"0"))
    elif s[i]=="1":
        buf = "".join((buf, "1"))
    elif s[i]=="B":
        if len(buf)>0:
            buf=buf[:len(buf)-1]
    #print(buf)
print(buf)

Submission status: Accepted

Solution code:
a=input()
A=[]
for i in a:
  if i=='B'and len(A)>0:
    del A[-1]
  elif i=='1'or i=='0':
    A.append(i)
print(*A,sep='')

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" and 0 < len(ans):
        ans.pop()

print("".join(ans))

Submission status: Accepted

Solution code:
S = input()

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

print("".join(a for a in ans))

Submission status: Accepted

Solution code:
s = input()
t=[]
for c in s:
    if c!='B':
        t.append(c)
    elif len(t)!=0 :
        t.pop()

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

Submission status: Accepted

Solution code:
s = input()
t=[]
for c in s:
    if c!='B':
        t.append(c)
    elif len(t)!=0 :
        t.pop()

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

Submission status: Accepted

Solution code:
# B - バイナリハックイージー
s = input()
lst = []
for i in s:
    if i == 'B' and len(lst) !=0:
        lst.pop()
    elif i == 'B':
        continue
    else:
        lst.append(i)
print(''.join(lst))

Submission status: Accepted

Solution code:
s = input()

ans = []

for ss in s:
    if ss == '0':
        ans.append('0')
    elif ss == '1':
        ans.append('1')
    else:
        if len(ans) >= 1:
            del ans[-1]

print("".join(ans))

Submission status: Accepted

Solution code:
e = input()
array = []
for i in e:
    if i == 'B':
        if len(array) == 0:
            pass
        else:
            array.pop()
    else:
        array.append(i)
print(''.join(array))

Submission status: Accepted

Solution code:
def resolve():
    s = input()
    ans = []
    for char in s:
        if char == 'B':
            if len(ans) == 0:
                continue
            else:
                ans = ans[:-1]
        else:
            ans.append(char)

    print(''.join(ans))

resolve()

Submission status: Accepted

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

print(*ans, sep='')

Submission status: Accepted

Solution code:
a = input()

A = []

for i in a:
    if i != "B":
        A.append(i)
    else:
        if A == []:
            continue
        else:
            A = A[:-1]
print("".join(A))

Submission status: Accepted

Solution code:
s = input()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
Inp = input()
Ext = ''
for val in range(len(Inp)):
    if Inp[val] == '0':
        Ext += '0'
    elif Inp[val] == '1':
        Ext += '1'
    else:
        Ext = Ext[:-1]
print(Ext)

Submission status: Accepted

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

print("".join(ans))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(n)

Submission status: Accepted

Solution code:
# 入力　文字列1つ
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 :
            ans.pop()

name = "".join(ans)

print(name)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=str(input())
while(s.count("B")!=0):
  i=s.find("B")
  if i!=0:
    s=s[:i-1]+s[i+1:]
  else:
    s=s[1:]
print(s)

Submission status: Accepted

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

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=list(input())
r=[]

for x in s:
    if x=="0":r.append("0")
    elif x=="1":r.append("1")
    elif x=="B" and len(r)>0:
        r.pop()
print("".join(r))

Submission status: Accepted

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

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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    S = list(input())
    reslut = []
    for s in S:
        if s == 'B' and len(reslut) == 0:
            continue
        elif s == 'B':
            reslut.pop()
        else:
            reslut.append(s)
    print(''.join(reslut))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
k = str(input())
n = list(k)
l = []
s = ""
for i in n:
    if(i == '0'):l.append(i)
    if(i == '1'):l.append(i)
    if(i == 'B'):
        if(len(l)==0):
            continue
        else:
            l.pop()
print(s.join(l))

Submission status: Accepted

Solution code:
str = input()
answer = ""
for x in range(len(str)):
    if str[x] != "B": answer += str[x]
    else:
        if len(answer) > 0: answer = answer[0:len(answer) - 1]
print(answer)

Submission status: Accepted

Solution code:
s=list(input())
r=[]
for x in s:
    if x=="0":r.append("0")
    if x=="1":r.append("1")
    if x=="B" and len(r)>0:
        r.pop()
print("".join(r))

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

print("".join(ans))

Submission status: Accepted

Solution code:
a = list(input())

answer = []

for i in a:
  
  if i == "1" or i == "0":
    answer.append(i)
  else:
    if not answer :
      continue
    else:
      del answer[-1]

print("".join(answer))

Submission status: Accepted

Solution code:
s=input()
ans=[]
for i in s:
    if i!="B":
        ans.append(i)
    else:
        if ans!=[]:
            ans.pop(-1)
p=""
for j in ans:
   p+=j 
print(p)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys
# import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = readline().decode('utf8').rstrip()

lis = []

for m in S:
    if m != 'B':
        lis.append(m)
    else:
        if len(lis):
            lis.pop()

print(*lis, sep='')

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys
import itertools

import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = readline().decode('utf8').rstrip()

lis = []

for m in S:
    if m != 'B':
        lis.append(m)
    else:
        if len(lis):
            lis.pop()

print(*lis, sep='')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
o = []
for i in s:
    if i == "B":
        if len(o) == 0:
            pass
        else:
            o.pop(-1)

    else:
        o += [i]

print("".join(o))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
lis = []
for i in range(len(s)):
    if s[i] == '1' or s[i] == '0':
        lis.append(s[i])
    elif len(lis) >= 1 and s[i] == 'B':
        lis.pop(-1)
ans = lis[0]
for i in range(1, len(lis)):
    ans += lis[i]
print(ans)

Submission status: Accepted

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

    result = ""
    for chr in data:
        if chr == "0":
            result += "0"
        elif chr == "1":
            result += "1"
        elif chr == "B":
            result = result[:-1]

    print(result)

if __name__ == "__main__":
    main()

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 ans:
            ans.pop(-1)
        else:
            pass
print("".join(ans))

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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')
    elif s[i]=='B' and len(l)!=0:
        l.pop()
    
for i in l:
    print(i,end='')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=""
l=[]
string = input()
key=[]
for j in string:
    key.append(j)

for i in key:
    if i=='0':
        l.append(i)
    elif i=='1':
        l.append(i)
    elif i=='B':
        if len(l)==0:
            pass
        else:
            l.pop()

for i in l:
    s=s+i
print(s)

Submission status: Accepted

Solution code:
string = input()
l = 0
string1 = []
 
for i in string:
    if(i == '1'):
        string1.append('1')
        l += 1
    elif(i == '0'):
        string1.append('0')
        l += 1
    elif(i == 'B'):
        if(l > 0):
            string1.pop()
            l = l - 1
 
for i in string1:
    print(i, end = '')

Submission status: Accepted

Solution code:
s = input()
len = 0
op = []

for i in s:
    if(i == '1'):
        op.append('1')
        len += 1
    elif(i == '0'):
        op.append('0')
        len += 1
    elif(i == 'B'):
        if(len > 0):
            op.pop()
            len = len - 1

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

Submission status: Accepted

Solution code:
s = input()

s = list(s)
k = []
a = ''
for i in s:
    if k != [] and i == 'B':
        k.pop()
    elif i != 'B':
        k.append(i)
    
print(a.join(k))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

output = []

for i in s:
    if i != "B":
        output.append(i)
    elif output != []:
        output.pop()

print(''.join(output))

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S=list(input())
T =[]
for i in range(len(S)):
  if S[i]=='B':
    T=T[:-1]
  else:
    T.append(S[i])
print(''.join(T))

Submission status: Accepted

Solution code:
def solve(s):
    l = []
    for c in s:
        if c != 'B':
            l.append(c)
        elif l:
            l.pop()
    return ''.join(l)

_s = input()
print(solve(_s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

s=input()
def solution(s):
    new = []
    for c in s:
        if c == '0':
            new.append('0')
        elif c == '1':
            new.append('1')
        elif c == 'B':
            try:
                new.pop()
            except:
                pass
    newnew = ''.join(new)
    return newnew
print(solution(s))

Submission status: Accepted

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

print(result)

Submission status: Accepted

Solution code:
inputs = list(map(str, input()))
 
output = ''
for i in inputs:
    if i == 'B':
        output = output[:-1]
    elif i == '1':
        output += '1'
    else:
          output += '0'
print(output)

Submission status: Accepted

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

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

print(''.join(ans))

Submission status: Accepted

Solution code:
s = str(input())

r = ''

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

print(r)

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

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

Submission status: Accepted

Solution code:
S=list(input())
stack=[]
for s in S:
    if s!="B":
        stack.append(s)
    elif len(stack)!=0:
        stack.pop()


print("".join(stack))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

# キー入力
key = input()

display = ""
for i in key:
    if i == '0':
        # '0'を追加
        display += '0'
    if i == '1':
        # '1'を追加
        display += '1'
    if i == 'B':
        # 一番後ろの文字を削除
        display = display[:-1]

print(display)

Submission status: Accepted

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

for i in range(len(S)):
    if S[i] == "0" or S[i] == "1":
        List.append(S[i])
    else:
        if len(List) != 0:
            List.pop()
for j in range(len(List)):
    print(List[j], end='')

Submission status: Accepted

Solution code:
def keyboard_function(input_keyboard, editor_display):

    if input_keyboard=='B':
        if editor_display==[]:
            return editor_display
        else:
            editor_display.pop()
    if input_keyboard=='0':
        editor_display.append('0')
    if input_keyboard=='1':
        editor_display.append('1')
        
    return editor_display

def show_editor_display(input_keyboard_sequence):
    editor_display=[]
    for i in input_keyboard_sequence:
        keyboard_function(i, editor_display)        
    return ''.join(editor_display)

if __name__=='__main__':
    input_keyboard_sequence=input()
    print(show_editor_display(input_keyboard_sequence))