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

l = len(s)
ans = []

for i in range(l):
    if s[i] == str(0):
        ans.append(str(0))
    elif s[i] == str(1):
        ans.append(str(1))
    else:
        if ans == []:
          continue
        else:
          del ans[-1]
        
print(*ans, sep='')

Solution (Python):
from collections import deque
def solve():
    S = input()
    q = deque()

    for op in S:
        if op == '0':
            q.append(op)
        elif op == '1':
            q.append(op)
        else:
            if not len(q) == 0:
                q.pop()
    
    print("".join(list(q)))

if __name__ == '__main__':
    solve()

Solution (Python):
s=input()

display=[]
for i in s:
    if i=="0" or i=="1":
        display.append(i)
    elif display==[]:
        pass
    else:
        display.pop()
print("".join(display))

Solution (Python):
s = input()

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

print(''.join(o))

Solution (Python):
s=input()

display=[]
for i in s:
    if i=="0" or i=="1":
        display.append(i)
    elif display==[]:
        pass
    else:
        display.pop()
print("".join(display))

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

Solution (Python):
from collections import deque
s=deque(input())
A=deque()
for i in range(len(s)):
  a=s.popleft()
  if a=="B":
    if len(A)>0:
      A.pop()
  else:
    A.append(a)
print("".join(A))

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    s = input().rstrip()
    N = len(s)
    ans = ""

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


if __name__ == "__main__":
    main()

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



ans = []

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

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

print(str_ans)

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

Solution (Python):
sam = input()
red = []
for i in sam:
  if i == "B":
    if red:
      del red[-1]
  else:
    red.append(i)
print(*red, sep="")

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

Solution (Python):
S = input()

s = []
for each in S:
    if each == 'B':
        if len(s) > 0:
            s.pop()
    else:
        s.append(each)
print(''.join(s))

Solution (Python):
S = list(input())
Answer = []

for s in S:
    if s == 'B' and Answer != []:
        del Answer[-1]
    elif s == 'B' and Answer == []:
        continue
    else:
        Answer.append(s)

print(*Answer, sep="")

Solution (Python):
a = ""

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

print(a)

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

for s in S:
  if s=="B":
    if a:
      a.pop()
  else:
    a.append(s)

print(*a,sep="")

Solution (Python):

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

Solution (Python):

import math
import itertools
import statistics

import collections




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

print(ans)

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

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

print(''.join(ans))

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

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

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

print(ans)

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

for i in s:
    if i == "1":
        k += "1"
    elif i == "0":
        k += "0"
    else:
        _len = len(k)
        k = k[:_len-1]

print(k)

Solution (Python):
from sys import stdin
from collections import deque
input = stdin.readline

s = input().rstrip()
d = deque([])

for i in s:
    if i != "B":
        d.append(i)
    else:
        if d:
            d.pop()
        else:
            pass

while d:
    print(d.popleft(), end="")

print()

Solution (Python):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
from collections import deque

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

s = i_s()
d = deque()

for x in s:
    if d and x == 'B':
        d.pop()
    elif x == '0' or x == '1':
        d.append(x)

print(*d, sep='')

Solution (Python):
s=input()
length = len(s)
ary = []

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

Solution (Python):
def solve(str):
  ans = ""
  for s in str:
    if s == '0':
      ans += '0'
    elif s == '1':
      ans += '1'
    elif s == 'B':
      if len(ans) == 0:
        continue
      else:
        ans = ans[:-1]
    else:
      RuntimeError("input is not 0 or 1 or B.")
      return
  return ans

if __name__ == "__main__":
  s = input()
  ans = solve(s)
  print(ans)

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

ans = []

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

print("".join(ans))

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

text=[]

while len(key)>0:
  t = key.pop(0)
  if t=='B' and len(text)<=0:
    pass
  elif t=='B' and len(text)>0:
    text.pop()
  elif t=='0':
    text.append('0')
  elif t=='1':
    text.append('1')
    
print(''.join(text))

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

for i in range(len(s)):
    if s[i] == '0' or s[i] == '1':
        ans.append(s[i])
    else:
        if ans:
            _ = ans.pop()


print(''.join(ans))

Solution (Python):

import sys
input = sys.stdin.readline










from collections import deque

S = input().rstrip()
d = deque()

for s in S:
    if s == "B":
        if len(d) > 0:
            d.pop()
    else:
        d.append(s)

print("".join(d))

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

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

from collections import deque
ans = deque([])
for i in range(len(s)):
    if s[i] == 'B':
        if ans:
            ans.pop()
    else:
        ans.append(s[i])

print(''.join([str(i) for i in ans]))

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

Solution (Python):
from collections import deque

S=input()
d=deque()
for s in S:
  if s == 'B':
    if len(d) != 0:
      d.pop()
  else:
    d.append(s)
print(''.join(d))

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

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

Solution (Python):
url = "https://atcoder.jp/contests/abc043/tasks/abc043_b"

def main():

    a = input()
    a = list(a)

    ans = []

    for v in a:
        if v == "B":
            if len(ans) == 0:
                pass
            else:
                ans.pop(-1)
        else:
            ans.append(v)
    print(''.join(ans))


if __name__ == '__main__':
    main()

Solution (Python):
y=""
a=str(input())
for i in range (len(a)):
    if a[i]=="B":
        y=y[:-1]
    else:
        y=y+a[i]
print(y)

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

Solution (Python):
s = input()
L = []
for i in s:
  if i == "B":
    if L:
      L.pop()
    else:
      pass
  else:
    L.append(i)
print("".join(L))

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

result = ""

for i in range(0, L):
  if s[i] == "0":
    result = result + "0"
  elif s[i] == "1":
    result = result + "1"
  else:
    if result == "":
      pass
    else:
      result = result[:-1]

print(result)

Solution (Python):
s=input()
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())
res=[]
for i in s:
    if i=="B":
        res=res[:-1]
    else:
        res.append(i)
print("".join(res))

Solution (Python):
s = input()
ans = ["0"]*len(s)
j = 0
for i in range(len(s)):
    if s[i] == "B":
        j -=1
        if j<0:
            j = 0
    else:
        ans[j]=s[i]
        j+=1
print("".join(ans[:j]))

Solution (Python):
ans = []
for i in input():
    if (i == '1' or i == '0'): ans.append(i) 
    if i == 'B' and len(ans) != 0: ans.pop() 
print(''.join(ans))

Solution (Python):




"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""





def main():
  s = input()
  ans = ""
  for a in s:
    if a == '0':
      ans+=a
    elif a == '1':
      ans+=a
    elif a == 'B':
      ans = ans[0:len(ans)-1]
  print(ans)
if __name__ == '__main__':
  main()

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

Solution (Python):
li = input()
li2 =[]
for n in li:
    if n == "0":
        li2.append("0")
    elif n == "1":
        li2.append("1")
    elif n == "B":
        if not len(li2) == 0:
            li2.pop()
print("".join(li2))

Solution (Python):
l = list(input())
ans = []
for i in range(len(l)):
  if l[i] != "B":
    ans.append(l[i])
  elif ans:
    del ans[-1]
print("".join(ans))

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

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

Solution (Python):
s=input()

out=''
for i in range(len(s)):
    if s[i]!='B':
        out+='{}'.format(s[i])
    else:
        out= out[:-1]
print(out)

Solution (Python):
S = list(input())
T = list()

for i in range(len(S)):
  if S[i] == "B":
    if len(T) == 0:
      pass
    else:
      T.pop(-1)
  else:
    T = T + list(S[i])
print(''.join(T))

Solution (Python):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


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

Solution (Python):
s = list(map(str,input()))

ans = []

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

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

Solution (Python):
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 len(a)>0:
            del a[-1]
print(''.join(a))

Solution (Python):
S=input()
s=[str(c) for c in(S)]
size=0
a=[]
for i in (s):
  if i=='1' or i=='0':
    a.append(i)
    size+=1
  else:
    if size!=0:
      a.pop(size-1)
      size-=1
for j in range(size):
  print(a[j],end="")

Solution (Python):
s = input()

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

Solution (Python):
s=input()
output=""
for n in range(0,len(s)):
    if s[n]=="0":
        output+="0"
    elif s[n]=="1":
        output+="1"
    elif s[n]=="B":
        if len(output)>=1:
            output=output[:len(output)-1]
print(output)

Solution (Python):
lista = list(input())
listb=[]
for a in lista:
    if a == "0" or a =="1":
        listb.append(a)
    elif a =="B":
        if len(listb)>0:
            listb.pop()
print(''.join(listb))

Solution (Python):

s = list(input())
result = []
for c in s:
    if c == 'B':
        if len(result) > 0:
            result.pop()
    else:
        result.append(c)

print(''.join(result))

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:
            pass
        else:
            del l[-1]
print(*l,sep='')

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:
            pass
        else:
            del l[-1]
print(*l,sep='')

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

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

for s in S:
  if s == "B" :
    if not stack:
      continue
    else:
      stack.pop()
      
  elif s == "0" or s=="1":
    stack.append(s)
    
    
print("".join(stack))

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

Solution (Python):
s = list(input())
a = []
for l in s:
	if l == '0':
		a.append('0')
	if l == '1':
		a.append('1')
	if l == 'B' and len(a) != 0:
		a.pop()
		
print(''.join(a)) if len(a) > 0 else print('')

Solution (Python):
s = input()

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

print(ans)

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

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

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

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

Solution (Python):

import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


def solve(s: str):
    ans = []
    for c in s:
        if c == "B":
            if len(ans) > 0:
                ans.pop()
        else:
            ans.append(c)
    if len(ans) == 0:
        print("error")
    else:
        print("".join(ans))
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    s = next(tokens)  
    solve(s)


if __name__ == '__main__':
    main()

Solution (Python):
_input = list(input())
_output = ""


for i in _input:
    if i == "B":
        if len(_output) > 0:
            _output = _output[0:-1]
    else:
        _output += i

print(_output)

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

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

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

Solution (Python):
str = input()
len_str = len(str)
result = ''
for i in str:
    if i != 'B':
        result = ''.join([result, i])
    elif len(result) > 0:
        result = result[:-1]

print(result)

Solution (Python):
"""
kari1 = '01B0' 
kari1 = '0BB1' 
in1 = kari1
"""
in1 = input()

RC = ''
for idx1 in range(len(in1)):
    if in1[idx1] == '0':
        RC = RC + '0'
    elif in1[idx1] == '1':
        RC = RC + '1'
    elif in1[idx1] == 'B':
        if RC != '':
            RC = RC[0:len(RC) - 1]

print(RC)

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

ans = ""

for x in s:
    if x in ["0","1"]:
        ans = ans + x
    else:
        ans = ans[:len(ans)-1]
print(ans)

Solution (Python):
s = input()

def put_key(x,ans):
  if x =="0":
    return ans + "0"
  elif x== "1":
    return ans + "1"
  else:
    ls = list(ans)
    if len(ls) == 0:
      return ans
    else:
      ls[-1] = ""
      return  "".join(ls)

ans =str("")
for t in range(len(s)):
  ans = put_key(s[t],ans)
print(ans)

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

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

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

Solution (Python):


from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key



__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

def mulinputs():
    return map(int,input().split())

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x



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

    stk = Stack()
    
    
    
    
    
    
    
    
    
    
    for s in S:
        if s == 'B':
            if stk.empty():
                pass
            else:
                stk.get()
        else:
            stk.put(s)

    ret = ''
    while not stk.empty():
        ret += stk.get()
    
    print(ret[::-1])

Solution (Python):
s = input()
ans = []
for i in range(int(len(s))):
    if s[i] == "0":
        ans.append(0)
    elif s[i] == "1":
        ans.append(1)
    elif s[i] == "B":
        if not ans:
            continue
        del ans[int(len(ans))-1]
for i in ans:
    print(i,end="")

Solution (Python):
x=input()
x=list(x)
y=[]
for i in range(len(x)):
	if x[i]=='B':
		if len(y)!=0:
			del y[-1]
	else:
		y.append(x[i])
print(*y,sep='')

Solution (Python):
import sys
input = sys.stdin.readline

def main():
    S = input().strip()


    ans = []
    for s in S:
        if s == 'B':
            if len(ans) > 0:
                ans.pop()
        else:
            ans.append(s)

    print("".join(ans))




if __name__ == '__main__':
    main()

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

Solution (Python):
s = input()
 
counter = 0
moji = ""
for i in s:
	
	if i == "B":
		moji = moji[:-1]
		
		continue
    	

	moji = moji+ i

print(moji)

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

Solution (Python):
from collections import deque

s = input()

res = deque()
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))

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

Solution (Python):
stack =[]

s = input()

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


print("".join(stack))

Solution (Python):
s=list(input())
from collections import deque
d=deque()
for i in s:
    if i=="0":
        d.append(i)
    elif i=="1":
        d.append(i)
    else:
        if len(d)>0:
            d.pop()
print(''.join(list(d)))

Solution (Python):
s=input()
s=list(s)
ans=[]
for ss in s:
    if ss=='0' or ss=='1':
        ans.append(ss)
    elif ss=='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':
        ans+=s[i]
    else:
        if len(ans)!=0:
            ans=ans[:-1]
print(ans)

Solution (Python):
import sys
from collections import deque

def solve():
    input = sys.stdin.readline
    s = input().strip("\n")
    q = deque()
    for i in range(len(s)):
        if s[i] == "0": q.append("0")
        elif s[i] == "1": q.append("1")
        else:
            if q: q.pop()
    print("".join(map(str, q)))

    return 0

if __name__ == "__main__":
    solve()

Solution (Python):
import sys
stdin = sys.stdin

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

s = list(ns())
ans = ''
from collections import deque
d=[]

for i in s:
    if i == '0':
        d.append('0')
    elif i == '1':
        d.append('1')
    elif i == 'B' and len(d) > 0:
        d.pop()

print(''.join(d))

Solution (Python):
S = input()
ans = []
for s in S:
    if s == "0":
        ans.append(0)
    elif s == "1":
        ans.append(1)
    else:
        if ans:
            ans.pop(-1)
print(*ans, sep='')

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

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

Solution (Python):


s = list(input())


result = []


for c in s:
    if c=='B':
        if len(result)>0:
            result.pop(-1)
    elif c=='0':
        result.append(c)
    elif c=='1':
        result.append(c)


print("".join(result))

Solution (Python):
S = list(input())
ret = [-1] * 100
for s in S:
    if s == "B":
        ret.pop()
    elif s == "0":
        ret.append(0)
    else:
        ret.append(1)

print(''.join(str(i) if i >= 0 else '' for i in ret))

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

Solution (Python):
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 len(ans) == 0: continue
    ans.pop(-1)
print("".join(ans))

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")
    elif s[i] == "B":
        ans = ans[0:-1]
print("".join(ans))

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

ans = ['']*11
index = 0
for s in S:
    if s != 'B':
        ans[index] = s
        index += 1
    elif index >= 1:
        index -= 1
        ans[index] = ''
print(''.join(ans))

Solution (Python):
S = input()
a = []
for c in S:
    if c == 'B':
        if a:
            a.pop()
    else:
        a.append(c)
print(''.join(a))

Solution (Python):
from collections import deque
S = input()

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

print(''.join(list(ans)))

Solution (Python):

import sys
input = sys.stdin.readline

s = input().rstrip()
ans = [] 
for ch in s:
    if ch in "01":
        ans.append(ch)
    if ch == "B" and ans:
        ans.pop()
print("".join([item for item in ans]))

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

Solution (Python):

s = list(input())

ans = []
for i in s:
    if len(ans) > 0 and i == 'B':
        ans.pop()
    if i == '0':
        ans.append('0')
    if i == '1':
        ans.append('1')
print(''.join(ans))

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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
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 STR(): return input()
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 = sys.maxsize
mod = 10 ** 9 + 7

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

Solution (Python):

n = input()
 
res = []
 
for char in n:
    if char == '0':
        res.append(char)
    elif char == '1':
        res.append(char)
    elif char == 'B':
        if len(res) > 0:
            res.pop()
 
print(''.join(res))

Solution (Python):
n = input()

res = []

for char in n:
    if char == '0':
        res.append(char)
    elif char == '1':
        res.append(char)
    elif char == 'B':
        if len(res) > 0:
            res.pop()

print(''.join(res))

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

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

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

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

print("".join(ans))

Solution (Python):
s = input()

p = []

for token in list(s):
    if token == "B":
        if not len(p) == 0:
            p.pop()
    else:
        p.append(token)

print("".join(p))

Solution (Python):
from collections import deque
s = input()
d = deque()
for i in s:
    if i == 'B' and len(d) > 0:
        _ = d.pop()
    if i != 'B':
        d.append(i)
print(''.join(d))

Solution (Python):
S = input()
e = ""

for i in range(len(S)):
    if S[i] == "0":
        e += "0"
    elif S[i] == "1":
        e += "1"
    else:
        if e != "":
            e = e[:len(e) -1]

print(e)

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

Solution (Python):
s = input()

ans = []

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

print("".join(ans))

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

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