import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    Deque<Integer> deq = new ArrayDeque<>();
    for(int i = 0; i < S.length(); i++){
      if(S.charAt(i) == '0'){
        deq.push(0);
      }else if(S.charAt(i) == '1'){
        deq.push(1);
      }else if(deq.size() > 0){
        deq.pop();
      }
    }
    String ans = "";
    while(deq.size() > 0){
      ans = deq.pop() + ans;
    }
    
    System.out.println(ans);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    Deque<Integer> deq = new ArrayDeque<>();
    for(int i = 0; i < S.length(); i++){
      if(S.charAt(i) == '0'){
        deq.push(0);
      }else if(S.charAt(i) == '1'){
        deq.push(1);
      }else if(deq.size() > 0){
        deq.pop();
      }
    }
    String ans = "";
    while(deq.size() > 0){
      ans = deq.pop() + ans;
    }
    
    System.out.println(ans);
  }
} Main public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    Deque<Integer> deq = new ArrayDeque<>();
    for(int i = 0; i < S.length(); i++){
      if(S.charAt(i) == '0'){
        deq.push(0);
      }else if(S.charAt(i) == '1'){
        deq.push(1);
      }else if(deq.size() > 0){
        deq.pop();
      }
    }
    String ans = "";
    while(deq.size() > 0){
      ans = deq.pop() + ans;
    }
    
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    Deque<Integer> deq = new ArrayDeque<>();
    for(int i = 0; i < S.length(); i++){
      if(S.charAt(i) == '0'){
        deq.push(0);
      }else if(S.charAt(i) == '1'){
        deq.push(1);
      }else if(deq.size() > 0){
        deq.pop();
      }
    }
    String ans = "";
    while(deq.size() > 0){
      ans = deq.pop() + ans;
    }
    
    System.out.println(ans);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc Deque<Integer> deq = new ArrayDeque<>(); deq new ArrayDeque<>() for(int i = 0; i < S.length(); i++){
      if(S.charAt(i) == '0'){
        deq.push(0);
      }else if(S.charAt(i) == '1'){
        deq.push(1);
      }else if(deq.size() > 0){
        deq.pop();
      }
    } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
      if(S.charAt(i) == '0'){
        deq.push(0);
      }else if(S.charAt(i) == '1'){
        deq.push(1);
      }else if(deq.size() > 0){
        deq.pop();
      }
    } {
      if(S.charAt(i) == '0'){
        deq.push(0);
      }else if(S.charAt(i) == '1'){
        deq.push(1);
      }else if(deq.size() > 0){
        deq.pop();
      }
    } if(S.charAt(i) == '0'){
        deq.push(0);
      }else if(S.charAt(i) == '1'){
        deq.push(1);
      }else if(deq.size() > 0){
        deq.pop();
      } S.charAt(i) == '0' S.charAt(i) S.charAt S i '0' {
        deq.push(0);
      } deq.push(0) deq.push deq 0 if(S.charAt(i) == '1'){
        deq.push(1);
      }else if(deq.size() > 0){
        deq.pop();
      } S.charAt(i) == '1' S.charAt(i) S.charAt S i '1' {
        deq.push(1);
      } deq.push(1) deq.push deq 1 if(deq.size() > 0){
        deq.pop();
      } deq.size() > 0 deq.size() deq.size deq 0 {
        deq.pop();
      } deq.pop() deq.pop deq String ans = ""; ans "" while(deq.size() > 0){
      ans = deq.pop() + ans;
    } deq.size() > 0 deq.size() deq.size deq 0 {
      ans = deq.pop() + ans;
    } ans = deq.pop() + ans ans deq.pop() + ans deq.pop() deq.pop deq ans System.out.println(ans) System.out.println System.out System System.out ans String[]args args public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    Deque<Integer> deq = new ArrayDeque<>();
    for(int i = 0; i < S.length(); i++){
      if(S.charAt(i) == '0'){
        deq.push(0);
      }else if(S.charAt(i) == '1'){
        deq.push(1);
      }else if(deq.size() > 0){
        deq.pop();
      }
    }
    String ans = "";
    while(deq.size() > 0){
      ans = deq.pop() + ans;
    }
    
    System.out.println(ans);
  }
} public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    Deque<Integer> deq = new ArrayDeque<>();
    for(int i = 0; i < S.length(); i++){
      if(S.charAt(i) == '0'){
        deq.push(0);
      }else if(S.charAt(i) == '1'){
        deq.push(1);
      }else if(deq.size() > 0){
        deq.pop();
      }
    }
    String ans = "";
    while(deq.size() > 0){
      ans = deq.pop() + ans;
    }
    
    System.out.println(ans);
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    Deque<Integer> deq = new ArrayDeque<>();
    for(int i = 0; i < S.length(); i++){
      if(S.charAt(i) == '0'){
        deq.push(0);
      }else if(S.charAt(i) == '1'){
        deq.push(1);
      }else if(deq.size() > 0){
        deq.pop();
      }
    }
    String ans = "";
    while(deq.size() > 0){
      ans = deq.pop() + ans;
    }
    
    System.out.println(ans);
  }
}