import java.util.Scanner;

public class Main {
	public static void main(String[] args) {      
      Scanner sc = new Scanner(System.in);
      StringBuilder s = new StringBuilder(sc.next());
      while (true) {
        int B = s.indexOf("B"); 
        if (B == -1) break;
        if (B == 0) {
          s.deleteCharAt(B);
        } else {
          s.delete(B-1,B+1);
        }
      }
      System.out.println(s);
    }
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {      
      Scanner sc = new Scanner(System.in);
      StringBuilder s = new StringBuilder(sc.next());
      while (true) {
        int B = s.indexOf("B"); 
        if (B == -1) break;
        if (B == 0) {
          s.deleteCharAt(B);
        } else {
          s.delete(B-1,B+1);
        }
      }
      System.out.println(s);
    }
} Main public static void main(String[] args) {      
      Scanner sc = new Scanner(System.in);
      StringBuilder s = new StringBuilder(sc.next());
      while (true) {
        int B = s.indexOf("B"); 
        if (B == -1) break;
        if (B == 0) {
          s.deleteCharAt(B);
        } else {
          s.delete(B-1,B+1);
        }
      }
      System.out.println(s);
    } main {      
      Scanner sc = new Scanner(System.in);
      StringBuilder s = new StringBuilder(sc.next());
      while (true) {
        int B = s.indexOf("B"); 
        if (B == -1) break;
        if (B == 0) {
          s.deleteCharAt(B);
        } else {
          s.delete(B-1,B+1);
        }
      }
      System.out.println(s);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder s = new StringBuilder(sc.next()); s new StringBuilder(sc.next()) while (true) {
        int B = s.indexOf("B"); 
        if (B == -1) break;
        if (B == 0) {
          s.deleteCharAt(B);
        } else {
          s.delete(B-1,B+1);
        }
      } true {
        int B = s.indexOf("B"); 
        if (B == -1) break;
        if (B == 0) {
          s.deleteCharAt(B);
        } else {
          s.delete(B-1,B+1);
        }
      } int B = s.indexOf("B"); B s.indexOf("B") s.indexOf s "B" if (B == -1) break; B == -1 B -1 1 break; if (B == 0) {
          s.deleteCharAt(B);
        } else {
          s.delete(B-1,B+1);
        } B == 0 B 0 {
          s.deleteCharAt(B);
        } s.deleteCharAt(B) s.deleteCharAt s B {
          s.delete(B-1,B+1);
        } s.delete(B-1,B+1) s.delete s B-1 B 1 B+1 B 1 System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main {
	public static void main(String[] args) {      
      Scanner sc = new Scanner(System.in);
      StringBuilder s = new StringBuilder(sc.next());
      while (true) {
        int B = s.indexOf("B"); 
        if (B == -1) break;
        if (B == 0) {
          s.deleteCharAt(B);
        } else {
          s.delete(B-1,B+1);
        }
      }
      System.out.println(s);
    }
} public class Main {
	public static void main(String[] args) {      
      Scanner sc = new Scanner(System.in);
      StringBuilder s = new StringBuilder(sc.next());
      while (true) {
        int B = s.indexOf("B"); 
        if (B == -1) break;
        if (B == 0) {
          s.deleteCharAt(B);
        } else {
          s.delete(B-1,B+1);
        }
      }
      System.out.println(s);
    }
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {      
      Scanner sc = new Scanner(System.in);
      StringBuilder s = new StringBuilder(sc.next());
      while (true) {
        int B = s.indexOf("B"); 
        if (B == -1) break;
        if (B == 0) {
          s.deleteCharAt(B);
        } else {
          s.delete(B-1,B+1);
        }
      }
      System.out.println(s);
    }
}