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 .

Solution (Python):
s = str(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:
            continue
        else:
            ans = ans[:-1]
print(ans)

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

Solution (Python):
def main():
    N = str(input())
    result = ""

    for c in N:
        if c == '0':
            result = result + '0'
        elif c == '1':
            result = result + '1'
        elif c == 'B':
            result = result[0:len(result)-1]
    
    print(result)



if __name__ == "__main__":
    main()

Solution (Python):
s_list = list(map(str, input().rstrip()))

ans = []

for s in s_list:
    if s=="0":
        ans.append("0")
    elif s=="1":
        ans.append("1")
    elif s=="B":
        if len(ans)==0:
            continue
        else:
            ans.pop()

print("".join(ans))

Solution (Python):
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))

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

Solution (Python):
s = input()
l = []
for i in s:
    if i == "0":
        l.append("0")
    elif i == "1":
        l.append("1")
    else:
        if len(l) != 0:
            del l[-1]
        else:
            pass

print("".join(l))

Solution (Python):
S = input()
cha = list(S)
plist = []

for i in cha: 
    if i == "B":
        if plist != []:
            del plist[-1]
    else:
        plist.append(i)
            
plist = "".join(plist)

print(plist)

Solution (Python):
s = input()
t = []
for i in range(len(s)):
    if s[i] == "0":
        t.append('0')
    elif s[i] == "1":
        t.append('1')
    else:
        if len(t) != 0:
            del t[-1]
w = ''.join(t)
print(w)

Solution (Python):
s = input()

ans = []

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

print(''.join(ans))

Solution (Python):
s = str(input())
ans=''
for i in s:
    if i == '1' or  '0':
        ans = ans + i
    if i == 'B' and len(ans) > 0:
        ans = ans[:-2]
print(ans)

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

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

for s_i in s:
	if s_i == "B" and ans == "": continue
	if s_i == "B": ans = ans[:len(ans)-1]
	else: ans = ans + s_i
print(ans)

Solution (Python):


import sys






















def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    s = input()
    ans = ''
    for char in s:
        if char == 'B':
            ans = ans[:-1] if ans else ''
        else:
            ans += char

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import sys
import os
import math
import bisect
import collections
import itertools
import heapq
import re
import queue

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


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

    S = iss()
    qu = []

    for s in S:
        if len(qu) > 0 and s == 'B':
            qu.pop()
        elif s != 'B':
            qu.append(s)
    print(''.join(qu))


if __name__ == '__main__':
    main()

Solution (Python):
S = list(input())
ans = []
for s in S:
    if s == '0' or s == '1':
        ans.append(s)
    else:
        if ans:
            ans.pop()
        else:
            continue
print(''.join(ans))

Solution (Python):
s = input()

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

Solution (Python):

s = list(input())
mojiretu = ''
for idx, ji in enumerate(s):
    if ji == 'B':
        mojiretu = mojiretu[:-1]
    else:
        mojiretu += ji
print(mojiretu)

Solution (Python):
S=input()

ans=''
for i in S:
    if i=='0':
        ans+='0'
    elif i=='1':
        ans+='1'
    else:
        if len(ans)>=2:
            ans=ans[:len(ans)-1]
        else:
            ans=''

print(ans)

Solution (Python):
def main():
  num = input()
  ans=""
  for i in range(0,len(num)):
    if num[i]=='B':
      ans=ans[:-1]
    else:
      ans += num[i]
  print(ans)

main()

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

Solution (Python):
s = str(input())
ans = str("")

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

print(ans)

Solution (Python):
s=str(input())
s=list(s)
temp=[]
i=0
for i in range(0,len(s)):
  if s[i]=="1":
    temp.insert(0,"1")
  elif s[i]=="0":
    temp.insert(0,"0")
  else:
    if len(temp)!=0:
      del temp[0]
temp.reverse()
temp="".join(temp)
print(temp)

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

Solution (Python):
s = input()

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

Solution (Python):
s = input()

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

Solution (Python):
s = input()
ans = ''
for c in s:
    if c in {'0', '1'}:
        ans += c
    if c == 'B':
        if len(ans) != 0:
            ans = ans[:-1]
print(ans)

Solution (Python):
str_list=[]
tmp=[]
s=''
str_list=list(input())
for i in str_list:
    if i =='0':
        tmp.append('0')
    elif i == '1':
        tmp.append('1')
    elif i == 'B' and tmp:
        tmp.pop()
for i in range(len(tmp)):
    s+=tmp[i]
print(s)

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

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

print(ans)

Solution (Python):
from sys import stdin

def S(): return stdin.readline().rstrip()
def I(): return int(stdin.readline().rstrip())
def LS(): return list(stdin.readline().rstrip().split())
def LI(): return list(map(int,stdin.readline().rstrip().split()))

s = S()

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

print(ans)

Solution (Python):
import sys
import re
import math
import collections
import decimal
import bisect
import itertools
import fractions
import functools
import copy
import heapq
import decimal

sys.setrecursionlimit(10000001)
INF = sys.maxsize
MOD = 10 ** 9 + 7

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



def main():
    s = list(sys.stdin.readline())
    d = []

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

    print(*d, sep="")


if __name__ == '__main__':
    main()

Solution (Python):
ss = input()

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

print(ans)

Solution (Python):
s = input()
n = len(s)
d = []
for i in range(n):
    if s[i] == 'B':
        if len(d) > 0:
            d.pop()
    else:
        d.append(s[i])
print(''.join(d))

Solution (Python):
def cin():
	return map(int,input().split())

def cino(test=False):
    if not test:
        return int(input())
    else:
        return input()
def cina():
  return list(map(int,input().split()))

a = cino(True)
a = list(a)
s = []
for i in a:
    if i=='B' and len(s)>0:
        s.pop()
    elif i=='0' or i=='1':
        s.append(i)

print(''.join(s))

Solution (Python):
s = input()
ans = ""
for btn in s:
  if(btn == "0"):
    ans = ans + "0"
  if(btn == "1"):
    ans = ans + "1"
  if(btn == "B" and ans != ""):
    ans = ans[:len(ans)-1]
print(ans)

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9+7

s = input()
q = []
for i in range(len(s)):
    if s[i] == "0":
        q.append(0)
    elif s[i] == "1":
        q.append(1)
    elif s[i] == "B" and len(q)!=0:
        q.pop()
ans = ""
for i in range(len(q)):
    ans += str(q[i])
print(ans)

Solution (Python):
S = input()
string = ''
for c in S:
    if c == '0':
        string = string + '0'
    elif c == '1':
        string = string + '1'
    elif c == 'B':
        if string == '':
            pass
        else:
            string = string[:-1]
print(string)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
s = input()

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

print("".join(ans))

Solution (Python):
inputs = str(input())
ans = ""

for i in inputs:
    if i == 'B':
        ans = ans[:-1]
    else:
        ans += i

print(ans)

Solution (Python):
s = input()
ans = ''
s_list = list(s)
for num in s_list:
  if num == '0' or num == '1':
    ans += str(num)
  else:
    ans = ans[:-1]
print(ans)

Solution (Python):
ope = input()
result = list()
for i in ope:
    if i =="0" or i == "1":
        result.append(i)
    if i =="B":
        if len(result)!=0:
            result.pop()        
print("".join(result))

Solution (Python):
import sys

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

stack = []
for s_i in s:
    if s_i == "B":
        if stack:
            stack.pop()
    else:
        stack.append(s_i)

print("".join(stack))

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

Solution (Python):
ans=""
for i in list(input()):
    if ans and i=="B":ans=ans[:-1]
    else:ans=ans+i if i!="B" else ans
print(ans)

Solution (Python):
s = input()
ans = ""
for k in s:
  if k == 'B':
    if ans != "":
      ans = ans[:len(ans)-1]
  else:
    ans += k
print(ans)

Solution (Python):
from statistics import median


from fractions import gcd
from itertools import combinations 
from collections import deque
from collections import defaultdict
import bisect










import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))

def main():
    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)
if __name__ == '__main__':
  main()

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

Solution (Python):
def main():
    s = input()

    ans = ''
    b = 0
    for c in reversed(s):
        if c == 'B':
            b += 1
        else:
            if b:
                b -= 1
                continue
            ans = c + ans
    print(ans)


if __name__ == '__main__':
    main()

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

Solution (Python):
S=input()

ans=""

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

Solution (Python):
s = str(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[:-1]
        
print(ans)

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

Solution (Python):
s = input().strip()
x = ""
for i in range(len(s)):
    a = s[i]
    if a!="B":
        x += s[i]
    elif len(x)>0:
        x = x[:-1]
print(x)

Solution (Python):
S = list(input())
ans = []
for s in S:
    if s == '0':
        ans.append('0')
    elif s=='1':
        ans.append('1')
    elif len(ans)>=1:
        ans.pop()
print(''.join(ans))

Solution (Python):
s = input()
ans = []
for x in s:
    if x != 'B':
        ans.append(x)
    else:
        if ans:
            ans.pop()

print(''.join(ans))

Solution (Python):
def convert(s): 
  
    
    new = "" 
  
    
    for x in s: 
        new += x  
  
    
    return new 
s=input()
a=[]
for i in range(len(s)):
  if s[i]=='0':
    a.append('0')
  elif s[i]=='1':
    a.append('1')
  else:
    if len(a)>0:
      a.pop()
print(convert(a))

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

u=input().rstrip()
ans=""
for i in range(len(u)):
    if u[i]=="B":
        if ans!="":
            x=ans
            ans=""
            for j in range(len(x)-1):
                ans+=x[j]
    else:
        ans+=u[i]
    
print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    s = input()

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

    print("".join(res))


if __name__ == '__main__':
    resolve()

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

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

for s in S:
    if s == '0': ans.append(s)
    elif s == '1': ans.append(s)
    elif ans: ans.pop()

print(''.join(ans))

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

s = read().rstrip().decode()
ans = ''
for ss in s:
    if ss == 'B':
        if ans:
            ans = ans[:-1]
    else:
        ans += ss
print(ans)

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

ret = True
for v in s:
  if v == "0": ans.append("0")
  elif v == "1": ans.append("1")
  else:
    if not ans:continue
    ans.pop(-1)
print("".join(ans))

Solution (Python):
s = input()

ans_li=[]
for i in range(len(s)):
    if s[i]==str(0):
        ans_li.append(str(0))
    if s[i]==str(1):
        ans_li.append(str(1))
    if s[i]=='B':
        if len(ans_li)==0:
            continue
        del ans_li[-1]
print(''.join(ans_li))

Solution (Python):
S=input()
ans=[]
for s in S:
    if s=="B":
        if len(ans)==0:
            continue
        else:
            ans=ans[:-1]
    else:
        ans.append(s)
print("".join(map(str,ans)))

Solution (Python):
def main():
    S = input()
    ans = []
    for s in S:
        if s == "B" and ans:
            ans.pop()
        if s == "0" or s == "1":
            ans.append(s)
    print("".join(ans))


if __name__ == '__main__':
    main()

Solution (Python):
import sys
input = sys.stdin.readline
S = list(input())[: -1]
res = []
for x in S:
  if x == "B":
    if len(res): res.pop()
  else: res.append(x)
print("".join(res))

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

if __name__ == '__main__':
    main()

Solution (Python):
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) 
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    


MOD = 10**9 + 7
INF = 2**31  

from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  


S = input()
ans = []
for s in S:
    if s == 'B':
        if ans:
            del ans[-1]
    else:
        ans.append(s)
print("".join(ans))

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

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

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

Solution (Python):
N=input()
ans=[]
for i in N:
    if i=='B':
        if not ans==[]:
            ans.pop()
    else:
        ans.append(i)
print(''.join(ans))

Solution (Python):

import re
import math
from collections import defaultdict
import itertools
from copy import deepcopy
import random
from heapq import heappop,heappush
import time
import os
import queue
import sys
import datetime
from functools import lru_cache

readline=sys.stdin.readline
sys.setrecursionlimit(2000000)

alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def is_power(a,b):
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def get_facs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=""):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def floor_(n,x=1):
    return x*(n//x)
def ceil_(n,x=1):
    return x*((n+x-1)//x)
def hani(x,min_,max_):
    ret=x
    if x<min_:ret=min_
    if x>max_:ret=max_
    return ret
def seifu(x):
    return x//abs(x)


def main():
    s=input()
    ans=""
    for a in range(len(s)):
        if s[a]=="B":
            ans=ans[:-1]
        else:
            ans+=s[a]
    print(ans)
main()

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

ans = ''.join(ans)
print(ans)

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

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

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

Solution (Python):
s = str(input())

t = 0
a = list()
p = 0
for x in s:
    if x == "0":
        if p==0:
            a.append("0")
        else:
            a[t] = "0"
            p -= 1
        t +=1
    elif x == "1":
        if p==0:
            a.append("1")
        else:
            a[t] = "1"
            p-=1
        t +=1
    elif x == "B":
        if t != 0:
            t -=1
            p+=1

i = 0
ans = str()
while i < t:
    ans += a[i]
    i +=1
print(ans)

Solution (Python):
s = [p for p in 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))

Solution (Python):
S = input()
ANSlist = []

for i in range(len(S)):
    if S[i] == '0':
        ANSlist.append('0')
    elif S[i] == '1':
        ANSlist.append('1')
    elif S[i] == 'B':
        if len(ANSlist) >=1:
            del ANSlist[-1]

ANS = ''.join(ANSlist)

print(ANS)

Solution (Python):
from collections import deque

s = input()
ans = deque()

for i in s:
    if i == '0' or i == '1':
        ans.append(i)
    else:
        if len(ans) >= 1:
            ans.pop()
        else:
            continue
print(''.join(ans))

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

Solution (Python):
def main():
    s = list(input())
    from collections import deque
    q = deque()
    for i in s:
        if i == 'B':
            if len(q) > 0:
                t = q.pop()
        else:
            q.append(i)
    print(*list(q), sep='')

if __name__ == '__main__':
    main()

155284

Solution (Python):
def main():
  s = input()

  ans = ""

  for c in s:
    if(c == "0"):
      ans += "0"
    elif(c == "1"):
      ans += "1"
    elif(c == "B"):
      if(ans != ""):
        ans = ans[0:len(ans) - 1]

  print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
from collections import deque
s=deque(list(input()))
p=deque()
for i in range(len(s)):
    w=s.popleft()
    if w=="0":
        p.append("0")
    elif w=="1":
        p.append("1")
    else:
        if len(p)==0:
            continue
        else:
            p.pop()

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

Solution (Python):
s = list(input())

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

print("".join(ans))

Solution (Python):
s = input()
ans = []
dp = [""]*(len(s))
if s[0] != "B":
    dp[0] = s[0]
else:
    dp[0] = ""

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

Solution (Python):
S = input()
n = len(S)
stack = []

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7



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

Solution (Python):
s = list(input())

ans = []

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

Solution (Python):
S = input()
t = ''
for s in S:
  if s == 'B':
    t = t[:-1]
  else:
    t += s
print(t)

Solution (Python):
s=list(input())
ans=[]
for i in s:
    if i=="B":
        try:
            ans.pop(-1)
        except IndexError:
            pass
    else:
        ans.append(i)
print("".join(ans))

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

Solution (Python):
s = input()
editor = ""
for x in s:
    if x == "0":
        editor = editor + "0"
    elif x == "1":
        editor = editor + "1"
    else:
        if len(editor) == 0:
            continue
        else:
            editor = editor[:len(editor)-1]
print(editor)

Solution (Python):
s = str(input())
text = ""
for i in s:
    if i == "0" or i == "1":
        text += i
    else:
        text = text[0:len(text)-1]
print(text)

Solution (Python):
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:
        try:
            B.pop(-1)
        except IndexError:
            pass
print("".join(B))

Solution (Python):
def nyu():
    S =  list(map(str,input()))
    return S


def kansu(LS):
    ans = []
    ans_str =""

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


    print(ans_str)




S = nyu()
kansu(S)

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

Solution (Python):
s=input()
moji=[]
for i in range(0,len(s)):
  if s[i]=="1":
    moji.append("1")
  elif s[i]=="0":
    moji.append("0")
  else:
    try:
      moji.pop(-1)
    except IndexError:
      pass
kk=""
print(kk.join(moji))