import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        scanner.close();
        StringBuilder sb = new StringBuilder();

        for (char c : s.toCharArray()) {
            if (c == '0') {
                sb.append(0);
            } else if (c == '1') {
                sb.append("1");
            } else if (c == 'B') {
                if (sb.length() > 0)  {
                    sb.deleteCharAt(sb.length()-1);
                }
            }
        }

        System.out.println(sb.toString());
    }
} import java.util.Scanner; Scanner java.util public class Main {
    
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        scanner.close();
        StringBuilder sb = new StringBuilder();

        for (char c : s.toCharArray()) {
            if (c == '0') {
                sb.append(0);
            } else if (c == '1') {
                sb.append("1");
            } else if (c == 'B') {
                if (sb.length() > 0)  {
                    sb.deleteCharAt(sb.length()-1);
                }
            }
        }

        System.out.println(sb.toString());
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        scanner.close();
        StringBuilder sb = new StringBuilder();

        for (char c : s.toCharArray()) {
            if (c == '0') {
                sb.append(0);
            } else if (c == '1') {
                sb.append("1");
            } else if (c == 'B') {
                if (sb.length() > 0)  {
                    sb.deleteCharAt(sb.length()-1);
                }
            }
        }

        System.out.println(sb.toString());
    } main {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        scanner.close();
        StringBuilder sb = new StringBuilder();

        for (char c : s.toCharArray()) {
            if (c == '0') {
                sb.append(0);
            } else if (c == '1') {
                sb.append("1");
            } else if (c == 'B') {
                if (sb.length() > 0)  {
                    sb.deleteCharAt(sb.length()-1);
                }
            }
        }

        System.out.println(sb.toString());
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s = scanner.nextLine(); s scanner.nextLine() scanner.nextLine scanner scanner.close() scanner.close scanner StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (char c : s.toCharArray()) {
            if (c == '0') {
                sb.append(0);
            } else if (c == '1') {
                sb.append("1");
            } else if (c == 'B') {
                if (sb.length() > 0)  {
                    sb.deleteCharAt(sb.length()-1);
                }
            }
        } char c s.toCharArray() s.toCharArray s {
            if (c == '0') {
                sb.append(0);
            } else if (c == '1') {
                sb.append("1");
            } else if (c == 'B') {
                if (sb.length() > 0)  {
                    sb.deleteCharAt(sb.length()-1);
                }
            }
        } {
            if (c == '0') {
                sb.append(0);
            } else if (c == '1') {
                sb.append("1");
            } else if (c == 'B') {
                if (sb.length() > 0)  {
                    sb.deleteCharAt(sb.length()-1);
                }
            }
        } if (c == '0') {
                sb.append(0);
            } else if (c == '1') {
                sb.append("1");
            } else if (c == 'B') {
                if (sb.length() > 0)  {
                    sb.deleteCharAt(sb.length()-1);
                }
            } c == '0' c '0' {
                sb.append(0);
            } sb.append(0) sb.append sb 0 if (c == '1') {
                sb.append("1");
            } else if (c == 'B') {
                if (sb.length() > 0)  {
                    sb.deleteCharAt(sb.length()-1);
                }
            } c == '1' c '1' {
                sb.append("1");
            } sb.append("1") sb.append sb "1" if (c == 'B') {
                if (sb.length() > 0)  {
                    sb.deleteCharAt(sb.length()-1);
                }
            } c == 'B' c 'B' {
                if (sb.length() > 0)  {
                    sb.deleteCharAt(sb.length()-1);
                }
            } if (sb.length() > 0)  {
                    sb.deleteCharAt(sb.length()-1);
                } sb.length() > 0 sb.length() sb.length sb 0 {
                    sb.deleteCharAt(sb.length()-1);
                } sb.deleteCharAt(sb.length()-1) sb.deleteCharAt sb sb.length()-1 sb.length() sb.length sb 1 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 scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        scanner.close();
        StringBuilder sb = new StringBuilder();

        for (char c : s.toCharArray()) {
            if (c == '0') {
                sb.append(0);
            } else if (c == '1') {
                sb.append("1");
            } else if (c == 'B') {
                if (sb.length() > 0)  {
                    sb.deleteCharAt(sb.length()-1);
                }
            }
        }

        System.out.println(sb.toString());
    }
} public class Main {
    
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        scanner.close();
        StringBuilder sb = new StringBuilder();

        for (char c : s.toCharArray()) {
            if (c == '0') {
                sb.append(0);
            } else if (c == '1') {
                sb.append("1");
            } else if (c == 'B') {
                if (sb.length() > 0)  {
                    sb.deleteCharAt(sb.length()-1);
                }
            }
        }

        System.out.println(sb.toString());
    }
} Main
import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        scanner.close();
        StringBuilder sb = new StringBuilder();

        for (char c : s.toCharArray()) {
            if (c == '0') {
                sb.append(0);
            } else if (c == '1') {
                sb.append("1");
            } else if (c == 'B') {
                if (sb.length() > 0)  {
                    sb.deleteCharAt(sb.length()-1);
                }
            }
        }

        System.out.println(sb.toString());
    }
}
