import java.util.*;

public class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    String[] str = line.split("");
    StringBuilder editor = new StringBuilder();
    for(String s: str)
    {
      switch(s)
      {
        case "0":
          editor.append("0");
          break;
        case "1":
          editor.append("1");
          break;
        case "B":
          if(editor.length() > 0)
            editor.deleteCharAt(editor.length()-1);
          break;
      }
    }
    System.out.println(editor.toString());
  }

} import java.util.*; util.* java public class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    String[] str = line.split("");
    StringBuilder editor = new StringBuilder();
    for(String s: str)
    {
      switch(s)
      {
        case "0":
          editor.append("0");
          break;
        case "1":
          editor.append("1");
          break;
        case "B":
          if(editor.length() > 0)
            editor.deleteCharAt(editor.length()-1);
          break;
      }
    }
    System.out.println(editor.toString());
  }

} Main public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    String[] str = line.split("");
    StringBuilder editor = new StringBuilder();
    for(String s: str)
    {
      switch(s)
      {
        case "0":
          editor.append("0");
          break;
        case "1":
          editor.append("1");
          break;
        case "B":
          if(editor.length() > 0)
            editor.deleteCharAt(editor.length()-1);
          break;
      }
    }
    System.out.println(editor.toString());
  } main {
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    String[] str = line.split("");
    StringBuilder editor = new StringBuilder();
    for(String s: str)
    {
      switch(s)
      {
        case "0":
          editor.append("0");
          break;
        case "1":
          editor.append("1");
          break;
        case "B":
          if(editor.length() > 0)
            editor.deleteCharAt(editor.length()-1);
          break;
      }
    }
    System.out.println(editor.toString());
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc String[] str = line.split(""); str line.split("") line.split line "" StringBuilder editor = new StringBuilder(); editor new StringBuilder() for(String s: str)
    {
      switch(s)
      {
        case "0":
          editor.append("0");
          break;
        case "1":
          editor.append("1");
          break;
        case "B":
          if(editor.length() > 0)
            editor.deleteCharAt(editor.length()-1);
          break;
      }
    } String s str {
      switch(s)
      {
        case "0":
          editor.append("0");
          break;
        case "1":
          editor.append("1");
          break;
        case "B":
          if(editor.length() > 0)
            editor.deleteCharAt(editor.length()-1);
          break;
      }
    } {
      switch(s)
      {
        case "0":
          editor.append("0");
          break;
        case "1":
          editor.append("1");
          break;
        case "B":
          if(editor.length() > 0)
            editor.deleteCharAt(editor.length()-1);
          break;
      }
    } switch(s)
      {
        case "0":
          editor.append("0");
          break;
        case "1":
          editor.append("1");
          break;
        case "B":
          if(editor.length() > 0)
            editor.deleteCharAt(editor.length()-1);
          break;
      } s case "0": "0" case "0": editor.append("0") editor.append editor "0" break; case "1": "1" case "1": editor.append("1") editor.append editor "1" break; case "B": "B" case "B": if(editor.length() > 0)
            editor.deleteCharAt(editor.length()-1); editor.length() > 0 editor.length() editor.length editor 0 editor.deleteCharAt(editor.length()-1) editor.deleteCharAt editor editor.length()-1 editor.length() editor.length editor 1 break; System.out.println(editor.toString()) System.out.println System.out System System.out editor.toString() editor.toString editor String[] args args public class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    String[] str = line.split("");
    StringBuilder editor = new StringBuilder();
    for(String s: str)
    {
      switch(s)
      {
        case "0":
          editor.append("0");
          break;
        case "1":
          editor.append("1");
          break;
        case "B":
          if(editor.length() > 0)
            editor.deleteCharAt(editor.length()-1);
          break;
      }
    }
    System.out.println(editor.toString());
  }

} public class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    String[] str = line.split("");
    StringBuilder editor = new StringBuilder();
    for(String s: str)
    {
      switch(s)
      {
        case "0":
          editor.append("0");
          break;
        case "1":
          editor.append("1");
          break;
        case "B":
          if(editor.length() > 0)
            editor.deleteCharAt(editor.length()-1);
          break;
      }
    }
    System.out.println(editor.toString());
  }

} Main
import java.util.*;

public class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    String[] str = line.split("");
    StringBuilder editor = new StringBuilder();
    for(String s: str)
    {
      switch(s)
      {
        case "0":
          editor.append("0");
          break;
        case "1":
          editor.append("1");
          break;
        case "B":
          if(editor.length() > 0)
            editor.deleteCharAt(editor.length()-1);
          break;
      }
    }
    System.out.println(editor.toString());
  }

}