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

for i in s:
    if i == '0' or i == '1':
        ans.append(i)
    else:
        if len(ans) != 0:
            ans.pop()
print("".join(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:
import re
t = input()
while "B" in t:
    t = t.lstrip("B")
    t = re.sub('[0,1]B','', t)
print(t)

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

Solution code:
a=""
for x in input():a=(a+x,a[:-1])[x>"A"]
print(a)

Submission status: Accepted

Solution code:
i=input();a=""
for x in i:a=(a+x,a[:-1])[x>"A"]
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = []

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

print("".join(s))

Submission status: Accepted

Solution code:
from collections import deque

s = input()

ans = deque()

for i in s:
    if i == 'B':
        if ans != deque([]):
            ans.pop()
    else:
        ans.append(i)

ans = "".join(list(ans))

print(ans)

Submission status: Accepted

Solution code:
s = list(input())
for i in range(len(s)):
    if i == 0 and s[i] == "B":
        s[i] = ""
    elif s[i] == "B":
        s[i] = ""
        flg = 0
        back = 1
        while True:
            if s[i-back] == "":
                back += 1
            elif s[i-back] != "":
                s[i-back] = ""
                break
            if i-back<0: break
#            print(s)
print("".join(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
data = input()
x = ""

for i in range(len(data)):
    if data[i] == "B":
        if x != "":
            x = x[0:-1]
    else:
        x += data[i]

print(x)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
S = input()
a = []
for s in S:
    if s=='0' or s=='1':
        a.append(s)
    else:
        try:
            a.pop()
        except:
            pass
print(''.join(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

S = []
for i in range(len(s)):
    if s[i] == "0":
        S += s[i]
    elif s[i] == "1":
        S += s[i]
    elif len(S) == 0:
        pass
    else:
        del S[-1]
print("".join(S))

Submission status: Accepted

Solution code:
s = list(input())

ans = []
for i in range(len(s)):
    if s[i] != "B":
        ans.append(s[i])
    elif s[i] == "B":
        if len(ans) > 0:
            ans.pop()
        else:
            pass
print("".join(ans))

Submission status: Accepted

Solution code:
s = list(input())
l = len(s)
ans = []
for i in range(l):
  if len(ans) > 0 and s[i] == 'B':
    ans.pop()
    continue
  elif s[i] == 'B':
    continue
  ans.append(s[i])

print(''.join(ans))

Submission status: Accepted

Solution code:
s = str(input())

res = ''

slist = []

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

for i in range(len(slist)):
    res += slist[i]

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

s = input()

# print(s)

result_s = ""
for i in range(len(s)):
    # print(s[i])
    
    if s[i] == '0':
        # pass
        result_s += '0'
    
    if s[i] == '1':
        # pass
        result_s += '1'
    
    if s[i] == 'B':
        # pass
        if len(s) > 0:
            result_s = result_s[:-1]
    
print(result_s)

Submission status: Accepted

Solution code:
a = []

for s in input():
    if s == 'B':
        if a == []:
            continue
        else:
            del a[-1]
    else:
        a.append(s)

print(''.join(a))

Submission status: Accepted

Solution code:
s = input()

out = ""
for i in range(len(s)):
  if s[i] == "0" or s[i] == "1":
    out += s[i]
  else:
    if len(out) == 0:
      pass
    else:
      out = out[:-1]
print(out)

Submission status: Accepted

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

Submission status: Accepted

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

for n in range(len(s)):
    if s[n] == '1' or s[n] == '0':
        output.append(s[n])
    elif s[n] == 'B' and output != []:
        backspace = len(output)-1
        output = output[:backspace]
print(''.join(output))

Submission status: Accepted

Solution code:
str=input()
x=list(str)
a=[]
for i in range(len(x)):
  if x[i]=='0' or x[i]=='1':
    a.append(x[i])
  else:
    if not a==[]:
      a.pop()
print(''.join(a))

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

for cha in s:
    if cha == 'B':
        if len(ans_s) == 0:
            continue
        else:
            ans_s = ans_s[:-1]
    else:
        ans_s += cha

print(ans_s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

s = IS()
a = ""
for txt in s:
    if txt != "B":
        a += txt
    else:
        if len(a) != 0:
            a = a[:-1]
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = []
for s in input():
    if "B" in s:
        if not a:continue
        else:a.pop()
    else:a.append(s)
print(*a,sep="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
ans = []
for i in s:
    if len(ans)!=0 and i=='B':
        ans.pop()
    elif i!='B':
        ans.append(i)
print(*ans,sep="")

Submission status: Accepted

Solution code:
def keyboard(s):
    result = ""
    for i in range(0,len(s)):
        if s[i] == "0":
            result += "0"
        elif s[i] == "1":
            result += "1"
        elif s[i] == "B":
            result = result[:-1]
    print(result)

keyboard(input())

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:
orders = input()
display = ''
for order in orders:
  if order == 'B':
    if display == '':
      pass
    elif display != '':
      display = display[:-1]
  elif order == '1':
    display = display + '1'
  elif order == '0':
    display = display + '0'

print(display)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

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

Submission status: Accepted

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

Submission status: Accepted

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

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: continue
    else: ans.pop()
    
print(*ans,sep ="")

Submission status: Accepted

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

Submission status: Accepted

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

print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():                                                                     
  data = raw_input()                                                            
  row = []                                                                      
  for c in data:                                                                
    if c == "B":                                                                
      if len(row):                                                              
        row.pop()                                                               
      continue                                                                  
    row.append(c)                                                               
  print(''.join(row))                                                           
                                                                                
main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

output = ""

for i in range(0, len(s)):
  if s[i] == "0" or s[i] == "1":
    output += s[i]
  else:
    if len(output) > 0:
      output = output[0:len(output)-1]

print(output)

Submission status: Accepted

Solution code:
stack=[]
for i in input():
    if i=="B" and stack:
        stack.pop()
    elif i!="B":
        stack.append(i)
print("".join(stack))

Submission status: Accepted

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

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

print(e)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
stack=[]
for i in s:
    if i=="B" and stack:
        stack.pop()
    elif i!="B":
        stack.append(i)
print("".join(stack))

Submission status: Accepted

Solution code:
S = input()
e = "" # えでぃた
for s in S:
  if s == "B":
    if e != "":
      e = e[:len(e)-1]
  else:
    e += s
print(e)

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

stack = []

for i in S:

    #Sの今の要素がBの時
    if i=="B":
        if len(stack)==0:
            continue
        else:
            stack.pop()
    else:
        #Sの今の要素が文字の時
        stack.append(i)
str = ""
for i in range(len(stack)):
    str = str+stack[i]
print(str)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(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[0:len(ans) - 1]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(input())
ans = []
for b in a:
    if  b == "0":
        ans.append("0")
    elif b == "1":
        ans.append("1")
    elif len(ans) != 0:
        ans.pop()
print("".join(ans))

Submission status: Accepted

Solution code:
def main():

    s = input()
    stack = []
    for c in s:
        if c in "01":
            stack.append(c)
        else:
            if stack:
                stack.pop()
    return "".join(stack)

if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
s = []
for c in input():
    if c == 'B':
        s and s.pop()
    else:
        s.append(c)

print(''.join(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
stack = ""
for x in s:
    if x in ["0", "1"]:
        stack += x
    else:
        if len(stack) != 0:
            stack = stack[:-1]
print(stack)

Submission status: Accepted

Solution code:
s = input()

result = []
for b in s:
    if b == '0':
        result.append('0')
    elif b == '1':
        result.append('1')
    else:
        result = result[:-1]
print(''.join(result))

Submission status: Accepted

Solution code:
ans = []
for w in input():
	if w == "B":
		try: ans.pop()
		except: pass
	else:
		ans.append(w)

print("".join(ans))

Submission status: Accepted

Solution code:
S=input()

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

Submission status: Accepted

Solution code:
a=list(input())
b=[]
for i in range(len(a)):
  if a[i]=="0":
    b.append("0")
  elif a[i]=="1":
    b.append("1")
  else:
    if b!=[]:
      b.pop()
print(*b,sep="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
ans = ""
for k in s:
    if k == "1":
        ans += "1"
    elif k == "0":
        ans += "0"
    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]=="0":
        t+="0"
    elif s[i]=="1":
        t+="1"
    elif s[i]=="B"and t!="":
        t=t[:-1]

print(t)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush, heapify
import math
import itertools
import random
 
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
INF = float('inf')
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    s = input()
    ans = ""
    
    for vol in s:
        if vol == "0":
            ans += "0"
        elif vol == "1":
            ans += "1"
        else:
            if len(ans) == 0:
                pass
            else:
                ans = ans[:-1]
                
    print(ans)
    
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
S = input()
ans = []
for s in S:
    if s=='B' and ans:
        ans.pop(-1)
    elif s!='B':
        ans.append(s)
print(''.join(ans))

Submission status: Accepted

Solution code:
s = input()
n = len(s)
w = "" #エディタの文字列

for i in range(n):
    if s[i] in {"0", "1"}:
        w += s[i]
    elif s[i] == "B":
        if len(w) != 0:
            w = w[:-1]

print(w)

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:
l=[i for i in input()]

ans_list=[]
for i in l:
  if i=='0' or i=='1':
    ans_list.append(i)
  else:
    if not ans_list==[]:
      ans_list.pop()
      
ans=''.join(ans_list)
print(ans)

Submission status: Accepted

Solution code:
lines = list(input())
answers = []
out = ""
for line in lines:
    if line == "0" or line == "1":
        answers.append(line)
    elif answers:
        answers.pop()
for answer in answers:
    out += answer
print(out)

Submission status: Accepted

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

for s in S:
  if s == "0" or s == "1":
    ans += s
  elif ans:
    ans = ans[0:len(ans)-1]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

s = input()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    sl = list(input())

    text = ""

    for s in sl:
        if s == "0" or s == "1":
            text = text + s
        elif s == "B":
            if text != "":
                text = text[:-1]

    print(text)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s1=input()
s2=""
for i in s1:
    if i=="0":
        s2+="0"
    elif i=="1":
        s2+="1"
    elif s2=="":
        pass
    else:
        s2=s2[:-1]

print(s2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
stack = []
for char in s:
    if char == "0" or char == "1":
        stack.append(char)
    else:
        if not stack:
            continue
        else:
            stack.pop()
print(*stack,sep="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = 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 = input()
o = []
for _s in s:
    if _s in ["0", "1"]:
        o.append(_s)
    else:
        if len(o) > 0:
            o.pop()
print("".join(o))

Submission status: Accepted

Solution code:
S = input()
editor = []
for s in S:
  if s=="0":
    editor.append(s)
  elif s=="1":
    editor.append(s)
  else:
    if len(editor)!=0:
      editor.pop()
print(*editor,sep="")

Submission status: Accepted

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

Submission status: Accepted

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

# input
s = input()

# solve
ans = list()
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()

# output
print(*ans, sep='')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(input())
L = []
for i in N:
    try:
        if i == "0":
            L.append("0")
        elif i == "1":
            L.append("1")
        else:
            L.pop(-1)
    except IndexError:
        pass
print("".join(L))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = []
for i in input():
  if i == '0':
    a.append('0')
  elif i == '1':
    a.append('1')
  else:
    try:
      a.pop()
    except:
      pass
print(''.join(a))

Submission status: Accepted

Solution code:

s = list(input())
ret = []

for c in s:
    if c == '0' or c == '1':
        ret.append(c)

    else:
        if len(ret) > 0:
            ret.pop()

print(*ret, sep="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ans=''
S=input()
for s in S:
    if s!='B':ans=ans+s
    else: ans=ans[:-1]
print(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()
rets = []
for s in S:
    if s=="0":
        rets.append("0")
    elif s=="1":
        rets.append("1")
    elif s=="B":
        if len(rets) > 0:
            rets.pop(-1)
print("".join(rets))

Submission status: Accepted

Solution code:
S=input()
ans=[""]*10
i=0
for s in S:
  if s=="B":
    if i==0:
      continue
    else:
      i-=1
      ans[i]=""
  else:
    ans[i]=s
    i+=1
print("".join(ans))

Submission status: Accepted

Solution code:
s = input()

line = []
for ch in s:
  if ch=='0' or ch=='1':
    line.append(ch)
  else: # 'b'
    if line:
      line.pop()
print(''.join(line))

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':
        if len(l) > 0:
            l.pop()

print(''.join(map(str, l)))

Submission status: Accepted

Solution code:
S=input()

result=[]

for s in S:
  #print(result)
  if s=="B":
    if len(result)>0:
      #print("nBack")
      result.pop()
  else:
    result.append(s)

print(*result,sep="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
l=[]
for s in S:
    if s!='B':
        l.append(s)
    else:
        if l==[]:
            pass
        else:
            l.pop()
print(*l,sep='')

Submission status: Accepted

Solution code:
s = input()
X = list(s)
Y = []

for i in range(len(X)):
    if X[i] != 'B':
        Y.append(X[i])
    else:
        if Y != []:
            Y.pop(-1)

ans = ''
for i in range(len(Y)):
    ans += Y[i]

print(ans)

Submission status: Accepted

Solution code:
s = input()
q = []
for si in s:
    if si == 'B':
        if len(q) != 0:
            q.pop()
        else:
            pass
    else:
        q.append(si)

print("".join(q))

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':
    S = input()

    out = []
    for s in S:
        if s=='B':
            try:
                out.pop(-1)
            except:
                pass
        else:
            out.append(s)

    print(''.join(out))

Submission status: Accepted

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

Submission status: Accepted

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

for s in S:
    if s == 'B' and ans:
        ans.pop()
    elif s != 'B':
        ans.append(s)

print(*ans, sep='')