Problem:


Score : 200 points

Problem Statement

Sig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.

To begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:

The 0 key: a letter 0 will be inserted to the right of the string.

The 1 key: a letter 1 will be inserted to the right of the string.

The backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.

Sig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?

Constraints

1 ≦ |s| ≦ 10 (|s| denotes the length of s)

s consists of the letters 0, 1 and B.

The correct answer is not an empty string.

Input

The input is given from Standard Input in the following format:

s

Output

Print the string displayed in the editor in the end.

Sample Input 1

01B0

Sample Output 1

00

Each time the key is pressed, the string in the editor will change as follows: 0, 01, 0, 00.

Sample Input 2

0BB1

Sample Output 2

1

Each time the key is pressed, the string in the editor will change as follows: 0, (empty), (empty), 1.



Sample input:
01B0


Sample output:
00

Submission status: Runtime Error

Solution code:
S = input()

S_list = list(S)
answer = []
for S_num in range(S_list):
    if S_num == '0':
        answer.append('0')
    elif S_num == '1':
        answer.append('1')
    else:
        del answer[-1]

print(answer)

Submission status: Runtime Error

Solution code:
s = list(input())
a = []

for i in s:
  if i == "0" or i == "1" :
    a += [i]
  elif: a != []
    del a[-1]

print(a)

Submission status: Runtime Error

Solution code:
s = str(input())

while 'B' in s:
    if s[0] == 'B':
    s=s[1:]
    s=s.replace('0B','')
    s=s.replace('1B','')

print(s)

Submission status: Runtime Error

Solution code:
s = list(input())

result = []

for i in range(len(s)):
    if i == 1:
        if s[i] != 'B':
            result.append(s[i])
    else:
        if s[i] != 'B':
            result.append(s[i])
        else:
            result.pop()

print(''.join(result))

Submission status: Runtime Error

Solution code:
#43b
s = list(input())
ans =''

for i in s:
    if i =='0' or i =='1':
        a+=i
    else:
        #最後の一つをスライス
        a = a[:-1]
print(a)

Submission status: Runtime Error

Solution code:
a=''
for i in input():
    if i=='B':
        a=a[:-1]
    else:
        a+=x
print(a)

Submission status: Runtime Error

Solution code:
a=list(input())
x=[]
for ai in a:
  if x !=[] and ai="B":
    l=len(x)
    del x[l-1]
  elif ai in ["0","1"]:
    x.append(ai)
print("".join(x))

Submission status: Runtime Error

Solution code:
inst = input()
buf = []
for s in inst:
  if s == "B":
    buf.pop()
  else:
    buf.append(s)
print(buf)

Submission status: Runtime Error

Solution code:
 a = input()

 ret = ""
 cnt = 0
 for i in a:
     if i == "B":
         ret = ret[:-1:]
     else:
         ret += i
 print(ret)

Submission status: Runtime Error

Solution code:
S = list(input())

L = []

for i, ch in enumerate(S):
    if ch != 'B':
        L.append(ch)
    elif len(L) > 0:
        del L[i - 1]

R = ''.join(L)
print(R)

Submission status: Runtime Error

Solution code:
S = list(input())

R = []

for i, ch in enumerate(S):
    if ch != 'B':
        R.append(ch)
    elif len(R) > 0:
        del R[i - 1]


print(''.join(R))

Submission status: Runtime Error

Solution code:
S = input()
s = ""
i = 0
for c in S:
  if c == '0' or c == '1':
    s[i] = c
    i += 1
  else:
    if i > 0:
      s[i] = ''
      i -= 1

Submission status: Runtime Error

Solution code:
S = input()
ret = []
for s in S:
    if s == 'B' and len(s):
        ret.pop()
    else:
        ret.append(s)
print(''.join(ret))

Submission status: Runtime Error

Solution code:
s=str(input())
while "B" in s:
  if s[0] == "B":
    del s[0]
  s=s.replace("0B","")
  s=s.replace("1B","")
print(s)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

def list_n():
    return [int(e) for e in input().split()]


def list_s():
    return [s for e in input().split()]


def main(s):
    ret = []
    for c in s:
        if c in ['0', '1']:
            ret.append(c)
        else:
            if c:
                ret.pop()
    return ''.join(ret)


if __name__ == '__main__':
    s = input()
    print(main(s))

Submission status: Runtime Error

Solution code:
def keyb(s):
	ans = ""
	for i in range(0, len(s)):
		if s[i] == 'B':
			ans.pop()
		else:
			ans.append(s[i])
	return ans

def main():
	s = raw_input()
	print keyb(s)

main()

Submission status: Runtime Error

Solution code:
s = raw_input()

if 'B' not in s:
    print s
else:
    str_list = list(s)
    output_list = []
    for i, c in enumerate(str_list):
        if c != 'B':
            output_list.append(c)
        else:
            # if output_list:
            if len(output_list) > 0:
                output_list.pop()

print ''.join(output_list)

Submission status: Runtime Error

Solution code:
s = raw_input()

if 'B' not in s:
    print s
else:
    str_list = list(s)
    output_list = []
    for i, c in enumerate(str_list):
        if c != 'B':
            output_list.append(c)
        else:
            if output_list:
                output_list.pop()

print ''.join(output_list)

Submission status: Runtime Error

Solution code:
s = list(map(str, input()))
display = []
for action in s:
    if action == '0':
        display.append('0')
    elif action == '1':
        display.append('1')
    elif action == 'B':
        display.pop()
print(''.join(display))

Submission status: Runtime Error

Solution code:
s=input()
a=""
for k in range(len(s)):
    if s[k]=="0":
        a=a+"0"
    elif s[k]=="1":
        a=a+"1"
    elif s[k]=="b":
        a=a.rstrip(a[-1])
print a

Submission status: Runtime Error

Solution code:
s =input()
ary = []
for c in s:
    if c == 'B':
        if len(ary) > 0:
            ary.pop()
    else:
        ary.append(c)
print(''join(ary))

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)

using namespace std;

int main(int argc, char const* argv[])
{
	string s;
	cin >> s;
	
	deque<char> q;
	rep(i, s.length()){
		if(s[i] == 'B' && !q.empty()){
			q.pop_back();
		} else if(s[i] != 'B'){
			q.push_back(s[i]);
		}
	}
	
	rep(i, q.size()){
		cout << q[i];
	}
	
	cout << endl;
	return 0;
}

Submission status: Runtime Error

Solution code:
s = raw_input()
words = []
for c in list(s):
    if c == 'B':
        words.pop()
    else:
        words.append(c)
print ''.join(words)

Submission status: Runtime Error

Solution code:
string = input()
result = []
j=0
for i in range(len(string)):
    if string[i]=='0':
        result.append('0')
    elif string[i]=='1':
        result.append('1')
    elif string[i]=='B' and len(result)>1 and result[-1] in ['0','1']
        result[-1]=""
str_result="".join(result)
print(str_result)

Submission status: Runtime Error

Solution code:
S = input()
A = []
for l in S:
	if l == '0' or l == '1':
		A.append(l)
	else:
		A.pop()
print("".join(A))