import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    String S = sc.next();

    sc.close();

    String[] s = S.split("");

    Deque<String> deque = new ArrayDeque<>();

    for (int i = 0; i < s.length; i++) {
      if (s[i].equals("0")) {
        deque.addLast("0");
      } else if (s[i].equals("1")) {
        deque.addLast("1");
      } else {
        if (0 < deque.size()) {
          deque.pollLast();
        }
      }
    }

    String result = "";

    for (String value : deque) {
      result += value;
    }

    System.out.println(result);

  }

} import java.util.*; util.* java public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    String S = sc.next();

    sc.close();

    String[] s = S.split("");

    Deque<String> deque = new ArrayDeque<>();

    for (int i = 0; i < s.length; i++) {
      if (s[i].equals("0")) {
        deque.addLast("0");
      } else if (s[i].equals("1")) {
        deque.addLast("1");
      } else {
        if (0 < deque.size()) {
          deque.pollLast();
        }
      }
    }

    String result = "";

    for (String value : deque) {
      result += value;
    }

    System.out.println(result);

  }

} Main public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    String S = sc.next();

    sc.close();

    String[] s = S.split("");

    Deque<String> deque = new ArrayDeque<>();

    for (int i = 0; i < s.length; i++) {
      if (s[i].equals("0")) {
        deque.addLast("0");
      } else if (s[i].equals("1")) {
        deque.addLast("1");
      } else {
        if (0 < deque.size()) {
          deque.pollLast();
        }
      }
    }

    String result = "";

    for (String value : deque) {
      result += value;
    }

    System.out.println(result);

  } main {

    Scanner sc = new Scanner(System.in);

    String S = sc.next();

    sc.close();

    String[] s = S.split("");

    Deque<String> deque = new ArrayDeque<>();

    for (int i = 0; i < s.length; i++) {
      if (s[i].equals("0")) {
        deque.addLast("0");
      } else if (s[i].equals("1")) {
        deque.addLast("1");
      } else {
        if (0 < deque.size()) {
          deque.pollLast();
        }
      }
    }

    String result = "";

    for (String value : deque) {
      result += value;
    }

    System.out.println(result);

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc sc.close() sc.close sc String[] s = S.split(""); s S.split("") S.split S "" Deque<String> deque = new ArrayDeque<>(); deque new ArrayDeque<>() for (int i = 0; i < s.length; i++) {
      if (s[i].equals("0")) {
        deque.addLast("0");
      } else if (s[i].equals("1")) {
        deque.addLast("1");
      } else {
        if (0 < deque.size()) {
          deque.pollLast();
        }
      }
    } int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
      if (s[i].equals("0")) {
        deque.addLast("0");
      } else if (s[i].equals("1")) {
        deque.addLast("1");
      } else {
        if (0 < deque.size()) {
          deque.pollLast();
        }
      }
    } {
      if (s[i].equals("0")) {
        deque.addLast("0");
      } else if (s[i].equals("1")) {
        deque.addLast("1");
      } else {
        if (0 < deque.size()) {
          deque.pollLast();
        }
      }
    } if (s[i].equals("0")) {
        deque.addLast("0");
      } else if (s[i].equals("1")) {
        deque.addLast("1");
      } else {
        if (0 < deque.size()) {
          deque.pollLast();
        }
      } s[i].equals("0") s[i].equals s[i] s i "0" {
        deque.addLast("0");
      } deque.addLast("0") deque.addLast deque "0" if (s[i].equals("1")) {
        deque.addLast("1");
      } else {
        if (0 < deque.size()) {
          deque.pollLast();
        }
      } s[i].equals("1") s[i].equals s[i] s i "1" {
        deque.addLast("1");
      } deque.addLast("1") deque.addLast deque "1" {
        if (0 < deque.size()) {
          deque.pollLast();
        }
      } if (0 < deque.size()) {
          deque.pollLast();
        } 0 < deque.size() 0 deque.size() deque.size deque {
          deque.pollLast();
        } deque.pollLast() deque.pollLast deque String result = ""; result "" for (String value : deque) {
      result += value;
    } String value deque {
      result += value;
    } {
      result += value;
    } result += value result value System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    String S = sc.next();

    sc.close();

    String[] s = S.split("");

    Deque<String> deque = new ArrayDeque<>();

    for (int i = 0; i < s.length; i++) {
      if (s[i].equals("0")) {
        deque.addLast("0");
      } else if (s[i].equals("1")) {
        deque.addLast("1");
      } else {
        if (0 < deque.size()) {
          deque.pollLast();
        }
      }
    }

    String result = "";

    for (String value : deque) {
      result += value;
    }

    System.out.println(result);

  }

} public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    String S = sc.next();

    sc.close();

    String[] s = S.split("");

    Deque<String> deque = new ArrayDeque<>();

    for (int i = 0; i < s.length; i++) {
      if (s[i].equals("0")) {
        deque.addLast("0");
      } else if (s[i].equals("1")) {
        deque.addLast("1");
      } else {
        if (0 < deque.size()) {
          deque.pollLast();
        }
      }
    }

    String result = "";

    for (String value : deque) {
      result += value;
    }

    System.out.println(result);

  }

} Main
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    String S = sc.next();

    sc.close();

    String[] s = S.split("");

    Deque<String> deque = new ArrayDeque<>();

    for (int i = 0; i < s.length; i++) {
      if (s[i].equals("0")) {
        deque.addLast("0");
      } else if (s[i].equals("1")) {
        deque.addLast("1");
      } else {
        if (0 < deque.size()) {
          deque.pollLast();
        }
      }
    }

    String result = "";

    for (String value : deque) {
      result += value;
    }

    System.out.println(result);

  }

}