output_description: Print the string displayed in the editor in the end.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      s
attempt: # /usr/bin/python3
  # -*- coding: utf-8 -*-
  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()
  
      ret, i = "", 0
      while i < len(S):
          if S[i] == "B":
              if i == 0:
                  ret = ""
              else:
                  ret = ret[:-2]
          else:
              ret += S[i]
          i += 1
      # 出力
      print(ret)
  
  
  # EOF
  
problem_description: 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?
samples: [{"input": "01B0", "output": "00\n    \n\nEach time the key is pressed, the string in the editor will change as follows:\n`0`, `01`, `0`, `00`.\n\n* * *"}, {"input": "0BB1", "output": "1\n    \n\nEach time the key is pressed, the string in the editor will change as follows:\n`0`, `(empty)`, `(empty)`, `1`."}]