import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String ss = sc.nextLine();
    StringBuilder sb = new StringBuilder();
    int j = 0;
    for (int i = 0; i < ss.length(); ++i) {
      switch (ss.charAt(i)) {
        case '1':
          sb.append("1");
          ++j;
          break;
        case '0':
          sb.append("0");
          ++j;
          break;
        case 'B':
          if (j > 0) {
            sb.delete(j - 1, j);
            --j;
          }
      }
    }
    System.out.println(sb.toString());
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String ss = sc.nextLine();
    StringBuilder sb = new StringBuilder();
    int j = 0;
    for (int i = 0; i < ss.length(); ++i) {
      switch (ss.charAt(i)) {
        case '1':
          sb.append("1");
          ++j;
          break;
        case '0':
          sb.append("0");
          ++j;
          break;
        case 'B':
          if (j > 0) {
            sb.delete(j - 1, j);
            --j;
          }
      }
    }
    System.out.println(sb.toString());
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String ss = sc.nextLine();
    StringBuilder sb = new StringBuilder();
    int j = 0;
    for (int i = 0; i < ss.length(); ++i) {
      switch (ss.charAt(i)) {
        case '1':
          sb.append("1");
          ++j;
          break;
        case '0':
          sb.append("0");
          ++j;
          break;
        case 'B':
          if (j > 0) {
            sb.delete(j - 1, j);
            --j;
          }
      }
    }
    System.out.println(sb.toString());
  } main {
    Scanner sc = new Scanner(System.in);
    String ss = sc.nextLine();
    StringBuilder sb = new StringBuilder();
    int j = 0;
    for (int i = 0; i < ss.length(); ++i) {
      switch (ss.charAt(i)) {
        case '1':
          sb.append("1");
          ++j;
          break;
        case '0':
          sb.append("0");
          ++j;
          break;
        case 'B':
          if (j > 0) {
            sb.delete(j - 1, j);
            --j;
          }
      }
    }
    System.out.println(sb.toString());
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String ss = sc.nextLine(); ss sc.nextLine() sc.nextLine sc StringBuilder sb = new StringBuilder(); sb new StringBuilder() int j = 0; j 0 for (int i = 0; i < ss.length(); ++i) {
      switch (ss.charAt(i)) {
        case '1':
          sb.append("1");
          ++j;
          break;
        case '0':
          sb.append("0");
          ++j;
          break;
        case 'B':
          if (j > 0) {
            sb.delete(j - 1, j);
            --j;
          }
      }
    } int i = 0; int i = 0; i 0 i < ss.length() i ss.length() ss.length ss ++i ++i i {
      switch (ss.charAt(i)) {
        case '1':
          sb.append("1");
          ++j;
          break;
        case '0':
          sb.append("0");
          ++j;
          break;
        case 'B':
          if (j > 0) {
            sb.delete(j - 1, j);
            --j;
          }
      }
    } {
      switch (ss.charAt(i)) {
        case '1':
          sb.append("1");
          ++j;
          break;
        case '0':
          sb.append("0");
          ++j;
          break;
        case 'B':
          if (j > 0) {
            sb.delete(j - 1, j);
            --j;
          }
      }
    } switch (ss.charAt(i)) {
        case '1':
          sb.append("1");
          ++j;
          break;
        case '0':
          sb.append("0");
          ++j;
          break;
        case 'B':
          if (j > 0) {
            sb.delete(j - 1, j);
            --j;
          }
      } ss.charAt(i) ss.charAt ss i case '1': '1' case '1': sb.append("1") sb.append sb "1" ++j j break; case '0': '0' case '0': sb.append("0") sb.append sb "0" ++j j break; case 'B': 'B' case 'B': if (j > 0) {
            sb.delete(j - 1, j);
            --j;
          } j > 0 j 0 {
            sb.delete(j - 1, j);
            --j;
          } sb.delete(j - 1, j) sb.delete sb j - 1 j 1 j --j j System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String ss = sc.nextLine();
    StringBuilder sb = new StringBuilder();
    int j = 0;
    for (int i = 0; i < ss.length(); ++i) {
      switch (ss.charAt(i)) {
        case '1':
          sb.append("1");
          ++j;
          break;
        case '0':
          sb.append("0");
          ++j;
          break;
        case 'B':
          if (j > 0) {
            sb.delete(j - 1, j);
            --j;
          }
      }
    }
    System.out.println(sb.toString());
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String ss = sc.nextLine();
    StringBuilder sb = new StringBuilder();
    int j = 0;
    for (int i = 0; i < ss.length(); ++i) {
      switch (ss.charAt(i)) {
        case '1':
          sb.append("1");
          ++j;
          break;
        case '0':
          sb.append("0");
          ++j;
          break;
        case 'B':
          if (j > 0) {
            sb.delete(j - 1, j);
            --j;
          }
      }
    }
    System.out.println(sb.toString());
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String ss = sc.nextLine();
    StringBuilder sb = new StringBuilder();
    int j = 0;
    for (int i = 0; i < ss.length(); ++i) {
      switch (ss.charAt(i)) {
        case '1':
          sb.append("1");
          ++j;
          break;
        case '0':
          sb.append("0");
          ++j;
          break;
        case 'B':
          if (j > 0) {
            sb.delete(j - 1, j);
            --j;
          }
      }
    }
    System.out.println(sb.toString());
  }
}
