import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
  String s = sc.next();
  while(s.contains("B")){
    int idx = s.indexOf("B");
    s = (idx > 0 ? s.substring(0,idx-1) : "") + s.substring(idx+1);
  }
  System.out.println(s);
}} import java.util.*; util.* java public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
  String s = sc.next();
  while(s.contains("B")){
    int idx = s.indexOf("B");
    s = (idx > 0 ? s.substring(0,idx-1) : "") + s.substring(idx+1);
  }
  System.out.println(s);
}} Main public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
  String s = sc.next();
  while(s.contains("B")){
    int idx = s.indexOf("B");
    s = (idx > 0 ? s.substring(0,idx-1) : "") + s.substring(idx+1);
  }
  System.out.println(s);
} main {
Scanner sc = new Scanner(System.in);
  String s = sc.next();
  while(s.contains("B")){
    int idx = s.indexOf("B");
    s = (idx > 0 ? s.substring(0,idx-1) : "") + s.substring(idx+1);
  }
  System.out.println(s);
} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc while(s.contains("B")){
    int idx = s.indexOf("B");
    s = (idx > 0 ? s.substring(0,idx-1) : "") + s.substring(idx+1);
  } s.contains("B") s.contains s "B" {
    int idx = s.indexOf("B");
    s = (idx > 0 ? s.substring(0,idx-1) : "") + s.substring(idx+1);
  } int idx = s.indexOf("B"); idx s.indexOf("B") s.indexOf s "B" s = (idx > 0 ? s.substring(0,idx-1) : "") + s.substring(idx+1) s (idx > 0 ? s.substring(0,idx-1) : "") + s.substring(idx+1) (idx > 0 ? s.substring(0,idx-1) : "") idx > 0 idx 0 s.substring(0,idx-1) s.substring s 0 idx-1 idx 1 "" s.substring(idx+1) s.substring s idx+1 idx 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);
  String s = sc.next();
  while(s.contains("B")){
    int idx = s.indexOf("B");
    s = (idx > 0 ? s.substring(0,idx-1) : "") + s.substring(idx+1);
  }
  System.out.println(s);
}} public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
  String s = sc.next();
  while(s.contains("B")){
    int idx = s.indexOf("B");
    s = (idx > 0 ? s.substring(0,idx-1) : "") + s.substring(idx+1);
  }
  System.out.println(s);
}} Main
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
  String s = sc.next();
  while(s.contains("B")){
    int idx = s.indexOf("B");
    s = (idx > 0 ? s.substring(0,idx-1) : "") + s.substring(idx+1);
  }
  System.out.println(s);
}}
