
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    // TODO 自動生成されたメソッド・スタブ
    Scanner sc = new Scanner(System.in);
    String s = sc.next();

    String str = "";
    for (int i = 0; i < s.length(); i++) {
      switch (s.charAt(i)) {
        case '0':
          str = str + "0";
          break;
        case '1':
          str = str + "1";
          break;
        case 'B':
          if (str.length() > 0) {
            str = str.substring(0, (str.length() - 1));
          }
          break;
      }
    }

    System.out.println(str);
  }
} import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    // TODO 自動生成されたメソッド・スタブ
    Scanner sc = new Scanner(System.in);
    String s = sc.next();

    String str = "";
    for (int i = 0; i < s.length(); i++) {
      switch (s.charAt(i)) {
        case '0':
          str = str + "0";
          break;
        case '1':
          str = str + "1";
          break;
        case 'B':
          if (str.length() > 0) {
            str = str.substring(0, (str.length() - 1));
          }
          break;
      }
    }

    System.out.println(str);
  }
} Main public static void main(String[] args) {
    // TODO 自動生成されたメソッド・スタブ
    Scanner sc = new Scanner(System.in);
    String s = sc.next();

    String str = "";
    for (int i = 0; i < s.length(); i++) {
      switch (s.charAt(i)) {
        case '0':
          str = str + "0";
          break;
        case '1':
          str = str + "1";
          break;
        case 'B':
          if (str.length() > 0) {
            str = str.substring(0, (str.length() - 1));
          }
          break;
      }
    }

    System.out.println(str);
  } main {
    // TODO 自動生成されたメソッド・スタブ
    Scanner sc = new Scanner(System.in);
    String s = sc.next();

    String str = "";
    for (int i = 0; i < s.length(); i++) {
      switch (s.charAt(i)) {
        case '0':
          str = str + "0";
          break;
        case '1':
          str = str + "1";
          break;
        case 'B':
          if (str.length() > 0) {
            str = str.substring(0, (str.length() - 1));
          }
          break;
      }
    }

    System.out.println(str);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String str = ""; str "" for (int i = 0; i < s.length(); i++) {
      switch (s.charAt(i)) {
        case '0':
          str = str + "0";
          break;
        case '1':
          str = str + "1";
          break;
        case 'B':
          if (str.length() > 0) {
            str = str.substring(0, (str.length() - 1));
          }
          break;
      }
    } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
      switch (s.charAt(i)) {
        case '0':
          str = str + "0";
          break;
        case '1':
          str = str + "1";
          break;
        case 'B':
          if (str.length() > 0) {
            str = str.substring(0, (str.length() - 1));
          }
          break;
      }
    } {
      switch (s.charAt(i)) {
        case '0':
          str = str + "0";
          break;
        case '1':
          str = str + "1";
          break;
        case 'B':
          if (str.length() > 0) {
            str = str.substring(0, (str.length() - 1));
          }
          break;
      }
    } switch (s.charAt(i)) {
        case '0':
          str = str + "0";
          break;
        case '1':
          str = str + "1";
          break;
        case 'B':
          if (str.length() > 0) {
            str = str.substring(0, (str.length() - 1));
          }
          break;
      } s.charAt(i) s.charAt s i case '0': '0' case '0': str = str + "0" str str + "0" str "0" break; case '1': '1' case '1': str = str + "1" str str + "1" str "1" break; case 'B': 'B' case 'B': if (str.length() > 0) {
            str = str.substring(0, (str.length() - 1));
          } str.length() > 0 str.length() str.length str 0 {
            str = str.substring(0, (str.length() - 1));
          } str = str.substring(0, (str.length() - 1)) str str.substring(0, (str.length() - 1)) str.substring str 0 (str.length() - 1) str.length() str.length str 1 break; System.out.println(str) System.out.println System.out System System.out str String[] args args public class Main {

  public static void main(String[] args) {
    // TODO 自動生成されたメソッド・スタブ
    Scanner sc = new Scanner(System.in);
    String s = sc.next();

    String str = "";
    for (int i = 0; i < s.length(); i++) {
      switch (s.charAt(i)) {
        case '0':
          str = str + "0";
          break;
        case '1':
          str = str + "1";
          break;
        case 'B':
          if (str.length() > 0) {
            str = str.substring(0, (str.length() - 1));
          }
          break;
      }
    }

    System.out.println(str);
  }
} public class Main {

  public static void main(String[] args) {
    // TODO 自動生成されたメソッド・スタブ
    Scanner sc = new Scanner(System.in);
    String s = sc.next();

    String str = "";
    for (int i = 0; i < s.length(); i++) {
      switch (s.charAt(i)) {
        case '0':
          str = str + "0";
          break;
        case '1':
          str = str + "1";
          break;
        case 'B':
          if (str.length() > 0) {
            str = str.substring(0, (str.length() - 1));
          }
          break;
      }
    }

    System.out.println(str);
  }
} Main

import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    // TODO 自動生成されたメソッド・スタブ
    Scanner sc = new Scanner(System.in);
    String s = sc.next();

    String str = "";
    for (int i = 0; i < s.length(); i++) {
      switch (s.charAt(i)) {
        case '0':
          str = str + "0";
          break;
        case '1':
          str = str + "1";
          break;
        case 'B':
          if (str.length() > 0) {
            str = str.substring(0, (str.length() - 1));
          }
          break;
      }
    }

    System.out.println(str);
  }
}
