import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

	public static void main(String[] args) throws Exception{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String s = br.readLine();
		List<Integer> l = new ArrayList<>();
		for(int i=0;i<s.length();i++)
		{
			if(s.charAt(i) == '0')
				l.add(0);
			else if(s.charAt(i) == '1')
				l.add(1);
			else
			{
				if(!l.isEmpty())
					l.remove(l.size()-1);
			}
		}
		StringBuilder sb = new StringBuilder();
		for(int i: l)
			sb.append(i);
		System.out.println(sb);
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util public class Main {

	public static void main(String[] args) throws Exception{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String s = br.readLine();
		List<Integer> l = new ArrayList<>();
		for(int i=0;i<s.length();i++)
		{
			if(s.charAt(i) == '0')
				l.add(0);
			else if(s.charAt(i) == '1')
				l.add(1);
			else
			{
				if(!l.isEmpty())
					l.remove(l.size()-1);
			}
		}
		StringBuilder sb = new StringBuilder();
		for(int i: l)
			sb.append(i);
		System.out.println(sb);
	}

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String s = br.readLine();
		List<Integer> l = new ArrayList<>();
		for(int i=0;i<s.length();i++)
		{
			if(s.charAt(i) == '0')
				l.add(0);
			else if(s.charAt(i) == '1')
				l.add(1);
			else
			{
				if(!l.isEmpty())
					l.remove(l.size()-1);
			}
		}
		StringBuilder sb = new StringBuilder();
		for(int i: l)
			sb.append(i);
		System.out.println(sb);
	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String s = br.readLine();
		List<Integer> l = new ArrayList<>();
		for(int i=0;i<s.length();i++)
		{
			if(s.charAt(i) == '0')
				l.add(0);
			else if(s.charAt(i) == '1')
				l.add(1);
			else
			{
				if(!l.isEmpty())
					l.remove(l.size()-1);
			}
		}
		StringBuilder sb = new StringBuilder();
		for(int i: l)
			sb.append(i);
		System.out.println(sb);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String s = br.readLine(); s br.readLine() br.readLine br List<Integer> l = new ArrayList<>(); l new ArrayList<>() for(int i=0;i<s.length();i++)
		{
			if(s.charAt(i) == '0')
				l.add(0);
			else if(s.charAt(i) == '1')
				l.add(1);
			else
			{
				if(!l.isEmpty())
					l.remove(l.size()-1);
			}
		} 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')
				l.add(0);
			else if(s.charAt(i) == '1')
				l.add(1);
			else
			{
				if(!l.isEmpty())
					l.remove(l.size()-1);
			}
		} {
			if(s.charAt(i) == '0')
				l.add(0);
			else if(s.charAt(i) == '1')
				l.add(1);
			else
			{
				if(!l.isEmpty())
					l.remove(l.size()-1);
			}
		} if(s.charAt(i) == '0')
				l.add(0);
			else if(s.charAt(i) == '1')
				l.add(1);
			else
			{
				if(!l.isEmpty())
					l.remove(l.size()-1);
			} s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' l.add(0) l.add l 0 if(s.charAt(i) == '1')
				l.add(1);
			else
			{
				if(!l.isEmpty())
					l.remove(l.size()-1);
			} s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' l.add(1) l.add l 1 {
				if(!l.isEmpty())
					l.remove(l.size()-1);
			} if(!l.isEmpty())
					l.remove(l.size()-1); !l.isEmpty() l.isEmpty() l.isEmpty l l.remove(l.size()-1) l.remove l l.size()-1 l.size() l.size l 1 StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i: l)
			sb.append(i); int i l sb.append(i); sb.append(i) sb.append sb i System.out.println(sb) System.out.println System.out System System.out sb String[] args args public class Main {

	public static void main(String[] args) throws Exception{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String s = br.readLine();
		List<Integer> l = new ArrayList<>();
		for(int i=0;i<s.length();i++)
		{
			if(s.charAt(i) == '0')
				l.add(0);
			else if(s.charAt(i) == '1')
				l.add(1);
			else
			{
				if(!l.isEmpty())
					l.remove(l.size()-1);
			}
		}
		StringBuilder sb = new StringBuilder();
		for(int i: l)
			sb.append(i);
		System.out.println(sb);
	}

} public class Main {

	public static void main(String[] args) throws Exception{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String s = br.readLine();
		List<Integer> l = new ArrayList<>();
		for(int i=0;i<s.length();i++)
		{
			if(s.charAt(i) == '0')
				l.add(0);
			else if(s.charAt(i) == '1')
				l.add(1);
			else
			{
				if(!l.isEmpty())
					l.remove(l.size()-1);
			}
		}
		StringBuilder sb = new StringBuilder();
		for(int i: l)
			sb.append(i);
		System.out.println(sb);
	}

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

	public static void main(String[] args) throws Exception{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String s = br.readLine();
		List<Integer> l = new ArrayList<>();
		for(int i=0;i<s.length();i++)
		{
			if(s.charAt(i) == '0')
				l.add(0);
			else if(s.charAt(i) == '1')
				l.add(1);
			else
			{
				if(!l.isEmpty())
					l.remove(l.size()-1);
			}
		}
		StringBuilder sb = new StringBuilder();
		for(int i: l)
			sb.append(i);
		System.out.println(sb);
	}

}
