import java.util.Scanner;
import java.util.ArrayList;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    
    String[] s = scanner.next().split("");
    ArrayList<String> result = new ArrayList<>();
    
    for(int i = 0; i < s.length; i++) {
      if(s[i].equals("0") || s[i].equals("1")) {
        result.add(s[i]);
      } else if(result.size() >= 1) {
        result.remove(result.size() - 1);
      }
    }
    
    for(String r: result) {
      System.out.print(r);
    }
  }
} import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    
    String[] s = scanner.next().split("");
    ArrayList<String> result = new ArrayList<>();
    
    for(int i = 0; i < s.length; i++) {
      if(s[i].equals("0") || s[i].equals("1")) {
        result.add(s[i]);
      } else if(result.size() >= 1) {
        result.remove(result.size() - 1);
      }
    }
    
    for(String r: result) {
      System.out.print(r);
    }
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    
    String[] s = scanner.next().split("");
    ArrayList<String> result = new ArrayList<>();
    
    for(int i = 0; i < s.length; i++) {
      if(s[i].equals("0") || s[i].equals("1")) {
        result.add(s[i]);
      } else if(result.size() >= 1) {
        result.remove(result.size() - 1);
      }
    }
    
    for(String r: result) {
      System.out.print(r);
    }
  } main {
    Scanner scanner = new Scanner(System.in);
    
    String[] s = scanner.next().split("");
    ArrayList<String> result = new ArrayList<>();
    
    for(int i = 0; i < s.length; i++) {
      if(s[i].equals("0") || s[i].equals("1")) {
        result.add(s[i]);
      } else if(result.size() >= 1) {
        result.remove(result.size() - 1);
      }
    }
    
    for(String r: result) {
      System.out.print(r);
    }
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String[] s = scanner.next().split(""); s scanner.next().split("") scanner.next().split scanner.next() scanner.next scanner "" ArrayList<String> result = new ArrayList<>(); result new ArrayList<>() for(int i = 0; i < s.length; i++) {
      if(s[i].equals("0") || s[i].equals("1")) {
        result.add(s[i]);
      } else if(result.size() >= 1) {
        result.remove(result.size() - 1);
      }
    } 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") || s[i].equals("1")) {
        result.add(s[i]);
      } else if(result.size() >= 1) {
        result.remove(result.size() - 1);
      }
    } {
      if(s[i].equals("0") || s[i].equals("1")) {
        result.add(s[i]);
      } else if(result.size() >= 1) {
        result.remove(result.size() - 1);
      }
    } if(s[i].equals("0") || s[i].equals("1")) {
        result.add(s[i]);
      } else if(result.size() >= 1) {
        result.remove(result.size() - 1);
      } s[i].equals("0") || s[i].equals("1") s[i].equals("0") s[i].equals s[i] s i "0" s[i].equals("1") s[i].equals s[i] s i "1" {
        result.add(s[i]);
      } result.add(s[i]) result.add result s[i] s i if(result.size() >= 1) {
        result.remove(result.size() - 1);
      } result.size() >= 1 result.size() result.size result 1 {
        result.remove(result.size() - 1);
      } result.remove(result.size() - 1) result.remove result result.size() - 1 result.size() result.size result 1 for(String r: result) {
      System.out.print(r);
    } String r result {
      System.out.print(r);
    } {
      System.out.print(r);
    } System.out.print(r) System.out.print System.out System System.out r String[] args args public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    
    String[] s = scanner.next().split("");
    ArrayList<String> result = new ArrayList<>();
    
    for(int i = 0; i < s.length; i++) {
      if(s[i].equals("0") || s[i].equals("1")) {
        result.add(s[i]);
      } else if(result.size() >= 1) {
        result.remove(result.size() - 1);
      }
    }
    
    for(String r: result) {
      System.out.print(r);
    }
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    
    String[] s = scanner.next().split("");
    ArrayList<String> result = new ArrayList<>();
    
    for(int i = 0; i < s.length; i++) {
      if(s[i].equals("0") || s[i].equals("1")) {
        result.add(s[i]);
      } else if(result.size() >= 1) {
        result.remove(result.size() - 1);
      }
    }
    
    for(String r: result) {
      System.out.print(r);
    }
  }
} Main
import java.util.Scanner;
import java.util.ArrayList;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    
    String[] s = scanner.next().split("");
    ArrayList<String> result = new ArrayList<>();
    
    for(int i = 0; i < s.length; i++) {
      if(s[i].equals("0") || s[i].equals("1")) {
        result.add(s[i]);
      } else if(result.size() >= 1) {
        result.remove(result.size() - 1);
      }
    }
    
    for(String r: result) {
      System.out.print(r);
    }
  }
}