import java.util.*;
import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader;

public class Main {
    static class IO {
        BufferedReader br;
        StringTokenizer st;

        public IO() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int[] readarray(int sz) {
            int[] ret = new int[sz];
            for (int i = 0; i < sz; i++)
                ret[i] = nextInt();
            return ret;
        }
    }

    public static void main(String[] args) {
        IO fs = new IO();
        String s = fs.nextLine();
        Stack<Integer> st = new Stack<Integer>();
        int n = s.length();
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == '0' || s.charAt(i) == '1') {
                st.push(s.charAt(i) - '0');
            } else {
                if (st.isEmpty())
                    continue;
                else
                    st.pop();
            }
        }
        ArrayList<Integer> ans = new ArrayList<Integer>();
        while(!st.empty()){
            ans.add(st.pop());
        }
        for(int i = ans.size()-1; i>=0; i--){
            System.out.print(ans.get(i));
        }
        System.out.println();
    }
} import java.util.*; util.* java import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    static class IO {
        BufferedReader br;
        StringTokenizer st;

        public IO() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int[] readarray(int sz) {
            int[] ret = new int[sz];
            for (int i = 0; i < sz; i++)
                ret[i] = nextInt();
            return ret;
        }
    }

    public static void main(String[] args) {
        IO fs = new IO();
        String s = fs.nextLine();
        Stack<Integer> st = new Stack<Integer>();
        int n = s.length();
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == '0' || s.charAt(i) == '1') {
                st.push(s.charAt(i) - '0');
            } else {
                if (st.isEmpty())
                    continue;
                else
                    st.pop();
            }
        }
        ArrayList<Integer> ans = new ArrayList<Integer>();
        while(!st.empty()){
            ans.add(st.pop());
        }
        for(int i = ans.size()-1; i>=0; i--){
            System.out.print(ans.get(i));
        }
        System.out.println();
    }
} Main public static void main(String[] args) {
        IO fs = new IO();
        String s = fs.nextLine();
        Stack<Integer> st = new Stack<Integer>();
        int n = s.length();
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == '0' || s.charAt(i) == '1') {
                st.push(s.charAt(i) - '0');
            } else {
                if (st.isEmpty())
                    continue;
                else
                    st.pop();
            }
        }
        ArrayList<Integer> ans = new ArrayList<Integer>();
        while(!st.empty()){
            ans.add(st.pop());
        }
        for(int i = ans.size()-1; i>=0; i--){
            System.out.print(ans.get(i));
        }
        System.out.println();
    } main {
        IO fs = new IO();
        String s = fs.nextLine();
        Stack<Integer> st = new Stack<Integer>();
        int n = s.length();
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == '0' || s.charAt(i) == '1') {
                st.push(s.charAt(i) - '0');
            } else {
                if (st.isEmpty())
                    continue;
                else
                    st.pop();
            }
        }
        ArrayList<Integer> ans = new ArrayList<Integer>();
        while(!st.empty()){
            ans.add(st.pop());
        }
        for(int i = ans.size()-1; i>=0; i--){
            System.out.print(ans.get(i));
        }
        System.out.println();
    } IO fs = new IO(); fs new IO() String s = fs.nextLine(); s fs.nextLine() fs.nextLine fs Stack<Integer> st = new Stack<Integer>(); st new Stack<Integer>() int n = s.length(); n s.length() s.length s for (int i = 0; i < n; i++) {
            if (s.charAt(i) == '0' || s.charAt(i) == '1') {
                st.push(s.charAt(i) - '0');
            } else {
                if (st.isEmpty())
                    continue;
                else
                    st.pop();
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if (s.charAt(i) == '0' || s.charAt(i) == '1') {
                st.push(s.charAt(i) - '0');
            } else {
                if (st.isEmpty())
                    continue;
                else
                    st.pop();
            }
        } {
            if (s.charAt(i) == '0' || s.charAt(i) == '1') {
                st.push(s.charAt(i) - '0');
            } else {
                if (st.isEmpty())
                    continue;
                else
                    st.pop();
            }
        } if (s.charAt(i) == '0' || s.charAt(i) == '1') {
                st.push(s.charAt(i) - '0');
            } else {
                if (st.isEmpty())
                    continue;
                else
                    st.pop();
            } s.charAt(i) == '0' || s.charAt(i) == '1' s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' {
                st.push(s.charAt(i) - '0');
            } st.push(s.charAt(i) - '0') st.push st s.charAt(i) - '0' s.charAt(i) s.charAt s i '0' {
                if (st.isEmpty())
                    continue;
                else
                    st.pop();
            } if (st.isEmpty())
                    continue;
                else
                    st.pop(); st.isEmpty() st.isEmpty st continue; st.pop() st.pop st ArrayList<Integer> ans = new ArrayList<Integer>(); ans new ArrayList<Integer>() while(!st.empty()){
            ans.add(st.pop());
        } !st.empty() st.empty() st.empty st {
            ans.add(st.pop());
        } ans.add(st.pop()) ans.add ans st.pop() st.pop st for(int i = ans.size()-1; i>=0; i--){
            System.out.print(ans.get(i));
        } int i = ans.size()-1; int i = ans.size()-1; i ans.size()-1 ans.size() ans.size ans 1 i>=0 i 0 i-- i-- i {
            System.out.print(ans.get(i));
        } {
            System.out.print(ans.get(i));
        } System.out.print(ans.get(i)) System.out.print System.out System System.out ans.get(i) ans.get ans i System.out.println() System.out.println System.out System System.out String[] args args static class IO {
        BufferedReader br;
        StringTokenizer st;

        public IO() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int[] readarray(int sz) {
            int[] ret = new int[sz];
            for (int i = 0; i < sz; i++)
                ret[i] = nextInt();
            return ret;
        }
    } IO BufferedReader br; br StringTokenizer st; st public IO() {
            br = new BufferedReader(new InputStreamReader(System.in));
        } IO {
            br = new BufferedReader(new InputStreamReader(System.in));
        } br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        } next {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        } while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } st == null || !st.hasMoreElements() st == null st null !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                } IOException e {
                    e.printStackTrace();
                } e.printStackTrace() e.printStackTrace e {
                    st = new StringTokenizer(br.readLine());
                } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next double nextDouble() {
            return Double.parseDouble(next());
        } nextDouble {
            return Double.parseDouble(next());
        } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        } nextLine {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        } String str = ""; str "" try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } IOException e {
                e.printStackTrace();
            } e.printStackTrace() e.printStackTrace e {
                str = br.readLine();
            } str = br.readLine() str br.readLine() br.readLine br return str; str int[] readarray(int sz) {
            int[] ret = new int[sz];
            for (int i = 0; i < sz; i++)
                ret[i] = nextInt();
            return ret;
        } readarray {
            int[] ret = new int[sz];
            for (int i = 0; i < sz; i++)
                ret[i] = nextInt();
            return ret;
        } int[] ret = new int[sz]; ret new int[sz] sz for (int i = 0; i < sz; i++)
                ret[i] = nextInt(); int i = 0; int i = 0; i 0 i < sz i sz i++ i++ i ret[i] = nextInt(); ret[i] = nextInt() ret[i] ret i nextInt() nextInt return ret; ret int sz sz public class Main {
    static class IO {
        BufferedReader br;
        StringTokenizer st;

        public IO() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int[] readarray(int sz) {
            int[] ret = new int[sz];
            for (int i = 0; i < sz; i++)
                ret[i] = nextInt();
            return ret;
        }
    }

    public static void main(String[] args) {
        IO fs = new IO();
        String s = fs.nextLine();
        Stack<Integer> st = new Stack<Integer>();
        int n = s.length();
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == '0' || s.charAt(i) == '1') {
                st.push(s.charAt(i) - '0');
            } else {
                if (st.isEmpty())
                    continue;
                else
                    st.pop();
            }
        }
        ArrayList<Integer> ans = new ArrayList<Integer>();
        while(!st.empty()){
            ans.add(st.pop());
        }
        for(int i = ans.size()-1; i>=0; i--){
            System.out.print(ans.get(i));
        }
        System.out.println();
    }
} public class Main {
    static class IO {
        BufferedReader br;
        StringTokenizer st;

        public IO() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int[] readarray(int sz) {
            int[] ret = new int[sz];
            for (int i = 0; i < sz; i++)
                ret[i] = nextInt();
            return ret;
        }
    }

    public static void main(String[] args) {
        IO fs = new IO();
        String s = fs.nextLine();
        Stack<Integer> st = new Stack<Integer>();
        int n = s.length();
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == '0' || s.charAt(i) == '1') {
                st.push(s.charAt(i) - '0');
            } else {
                if (st.isEmpty())
                    continue;
                else
                    st.pop();
            }
        }
        ArrayList<Integer> ans = new ArrayList<Integer>();
        while(!st.empty()){
            ans.add(st.pop());
        }
        for(int i = ans.size()-1; i>=0; i--){
            System.out.print(ans.get(i));
        }
        System.out.println();
    }
} Main
import java.util.*;
import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader;

public class Main {
    static class IO {
        BufferedReader br;
        StringTokenizer st;

        public IO() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int[] readarray(int sz) {
            int[] ret = new int[sz];
            for (int i = 0; i < sz; i++)
                ret[i] = nextInt();
            return ret;
        }
    }

    public static void main(String[] args) {
        IO fs = new IO();
        String s = fs.nextLine();
        Stack<Integer> st = new Stack<Integer>();
        int n = s.length();
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == '0' || s.charAt(i) == '1') {
                st.push(s.charAt(i) - '0');
            } else {
                if (st.isEmpty())
                    continue;
                else
                    st.pop();
            }
        }
        ArrayList<Integer> ans = new ArrayList<Integer>();
        while(!st.empty()){
            ans.add(st.pop());
        }
        for(int i = ans.size()-1; i>=0; i--){
            System.out.print(ans.get(i));
        }
        System.out.println();
    }
}
