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: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    S = input()
    R = ""

    for s in S:
        if s == "B":
            if len(R) >= 1:
                R = R[:-1]
        else:
            R += s
    
    print(R)


main()

Submission status: Accepted

Solution code:
S=input()
L=""
n=0
while n<=len(S)-1:
  if S[n]=="1":
    L+="1"
  elif S[n]=="0":
    L+="0"
  elif S[n]=="B" and L!="":
    L=L[:-1]
  n+=1
print(L)

Submission status: Accepted

Solution code:
st = input()

ans = ""
for s in st:
    if s != "B":
        ans += s
    elif len(s):
        ans = ans[:len(ans) - 1]

print(ans)

Submission status: Accepted

Solution code:
S = input()

ans = ""
for s in S:
    if s == "0":
        ans += s
    elif s == "1":
        ans += s
    else:
        ans = ans[:len(ans) - 1]

print(ans)

Submission status: Accepted

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

for i in range(len(a)):
  if a[i] == "0":
    b.append("0")
  elif a[i] == "1":
    b.append("1")
  elif a[i] == "B" and len(b) != 0:
    b.pop()
  else:
    continue
    
print("".join(b))

Submission status: Accepted

Solution code:
s = input()
ans = ''
for x in s:
    if x == 'B':
        if len(ans) == 0:
            continue
        else:
            ans = ans[:-1]
    else:
        ans += x

print(ans)

Submission status: Accepted

Solution code:
S=input()
L=""
for i in S:
    
    if i=="B":
        L=L[:-1]
       
    elif i!="B":
        L+=i
print(L)

Submission status: Accepted

Solution code:
ans = ""
for key in input():
    if key != "B":
        ans += key
    else:
        ans = ans[:-1]
print(ans)

Submission status: Accepted

Solution code:
## ABC 043 b

s = list(input())

ans = []
for i in s:
    if(i == '0' or i == '1'):
        ans.append(i)
    elif(i == 'B'):
        if(len(ans) == 0):
            continue
        else:
            ans.pop()
        
print(''.join(ans))

Submission status: Accepted

Solution code:
# coding: utf-8
s = input()

ans = []
for a in s:
    if a == "B":
        if ans:
            ans.pop()
    else:
        ans.append(a)
print("".join(ans))

Submission status: Accepted

Solution code:
# coding: utf-8
s = input()

ans = ""
for a in s:
    if a == "B":
        ans = ans[:-1]
    else:
        ans+=a
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
s = input()

ans = ""
for a in s:
    if a == "0":
        ans+="0"
    elif a == "1":
        ans+="1"
    else:
        ans = ans[:-1]
print(ans)

Submission status: Accepted

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

for i in range(len(a)):
  if a[i] == "0":
    b.append("0")
  elif a[i] == "1":
    b.append("1")
  elif a[i] == "B":
    if b == []:
      b = []
    else:
      del b[-1]
    
print("".join(b))

Submission status: Accepted

Solution code:
s = input()
A = []
moji = ''
for i in range(len(s)):
  if s[i]=='B':
    A = A[:-1]
  else:
    A.append(s[i])
moji = ''.join(A)
print(moji)

Submission status: Accepted

Solution code:
ans = []
for s in list(input()):
    if s == '0' or s == '1':
        ans.append(s)
    elif s == 'B':
        if not ans:
            continue
        ans.pop()
print(''.join(ans))

Submission status: Accepted

Solution code:
s = input()
m = []

for c in s:
  if c == 'B':
    if m:
      m.pop()
  else:
    m.append(c)

print(''.join(m))

Submission status: Accepted

Solution code:
s = input()
STR = []
for i in s:
    if i != 'B':
        STR.append(i)
    elif STR.__len__() == 0:
        continue
    else:
        STR.pop()

print("".join(STR))

Submission status: Accepted

Solution code:
S = input()
ans = ""
for c in S:
    if c == 'B':
        ans = ans[0:-1]
    else:
        ans += c
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
s=input()

r=''

for i in range(0,len(s)):
  if s[i]=='0' or s[i]=='1':
    r=r+s[i]
  elif len(s)>0:
    r=r[:-1]
print(r)

Submission status: Accepted

Solution code:
s = input()
ans = ""
for let in s:
    if let == '0' or let == '1':
        ans += let
    else:
        ans = ans[:-1]
print(ans)

Submission status: Accepted

Solution code:
s = list(input())
ans = ''
for i in s:
    if  i == '0' or i == '1':
        ans += i
    elif i == 'B' and len(ans) != 0:
        ans = ans[:-1]
print(ans)

Submission status: Accepted

Solution code:
s=list(input())
out=[]
for i in range(len(s)):
    if s[i]=="B" and out==[]:
        out=[]
    elif s[i]=="B":
        del(out[-1])
    else:
        out.append(s[i])
for i in range(len(out)):
    print(out[i],end="")

Submission status: Accepted

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

s = list(input())
line = []
for w in s:
    if w == '0':
        line.append(w)
    elif w == '1':
        line.append(w)
    elif w == 'B' and line:
        line.pop()

for n in line:
    print('{0}'.format(n), end='')

Submission status: Accepted

Solution code:
sS = input().rstrip()
a = []
for s in sS:
    if s == "B":
        if 0 < len(a):
            #del a[-1]
            a = a[:-1]
    else:
        a.append(s)
print("".join(a))

Submission status: Accepted

Solution code:

sS = input().rstrip()
a = []
for s in sS:
    if s == "B":
        if 0 < len(a):
            del a[-1]
    else:
        a.append(s)
print("".join(a))

Submission status: Accepted

Solution code:
a=list(input())
b=[]
for i in a:
    if (i=="0") or (i=="1"):
        b.append(i)
    elif b!=[] :
        b.pop(-1)
print("".join(b))

Submission status: Accepted

Solution code:
def main():
    s = input()
    ans = ''
    for ch in s:
        if ch == 'B' and len(ans) != 0:
            ans = ans[:-1]
        elif ch == 'B' and len(ans) == 0:
            ans = ''
        else:
            ans += ch

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    s = next_str()
    ans = []

    for v in s:
        if v == 'B':
            if len(ans) != 0:
                ans.pop()
        else:
            ans.append(v)

    print("".join(ans))


def next_str():
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
li = list(input())
string = ''
for item in li:
        if item == '0':
                string += '0'
        elif item == '1':
                string += '1'
        else:
                string = string[:-1]

print(string)

Submission status: Accepted

Solution code:
res = []
s = input()
for c in s:
    if c=='B':
        if len(res)!=0:
            res = res[:-1]
    else:
        res.append(c)
print(''.join(res))

Submission status: Accepted

Solution code:
S = input()

S_list = list(S)

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

answer_honmono = ''
answer_honmono = ''.join(answer)
print(answer_honmono)

Submission status: Accepted

Solution code:
l = [x for x in input()]
s = []
for x in l:
    if x == "0":
        s.append("0")
        
    elif x == "1":
        s.append("1")
    
    elif x == "B":
        try:
            del s[-1]
        except IndexError:
            pass
print("".join(s))

Submission status: Accepted

Solution code:
s=input()
ans=""
for i in range(len(s)):
    if s[i]=="0":
        ans=ans+"0"
    elif s[i]=="1":
        ans=ans+"1"
    elif s[i]=="B":
        if ans=="":
            pass
        
        else:
            ans=ans[:len(ans)-1]
    #print(str(ans))
print(str(ans))

Submission status: Accepted

Solution code:
ar = list(input())
br = []
for a in ar:
  if a == "0" or a == "1":
    br.append(a)
  else:
    if len(br) != 0:
    	del br[len(br)-1]
print("".join(br))

Submission status: Accepted

Solution code:
def main():
    S = input()
    answer = []
    for s in S:
        if s == "B":
            if answer:
                answer.pop()
        else:
            answer.append(s)
    print(''.join(answer))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#! /usr/bin/python3
# バイナリハックイージー / Unhappy Hacking (ABC Edit)
"""
    1. 先頭のB全部を消す
    2.
"""
import re

test_mode = False
s = str(input())

for _ in range(10):
    while s[0] == 'B':
        s = s[1:]
        if test_mode is True:
            print(s)
    s = re.sub('0B|1B', '', s)
    if 'B' not in s:
        print(s)
        break


"""
参考
    Pythonで文字列の最初・最後の１文字（数文字）を削除する
    https://robotics4society.com/2017/06/29/python_mojisakujo/
"""

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin

s = stdin.readline().rstrip()
ans = ""

for i in range(len(s)):
    ans += s[i]
    if s[i] == "B":
        ans = ans[:-2]

print(ans)

Submission status: Accepted

Solution code:
s = input()
ans = ""
for c in s:
    if c ==  "1":
        ans += "1"
    elif c == "0":
        ans += "0"
    else:
        ans = ans[:-1]
print(ans)

Submission status: Accepted

Solution code:
S = input()
ans = ''
for c in S:
    if c == '0' or c == '1':
        ans += c
    else:
        if ans == '': continue
        ans = ans[:-1]
print(ans)

Submission status: Accepted

Solution code:
S = input()
ans = ''
for c in S:
    if c == '0':
        ans += '0'
    elif c == '1':
        ans += '1'
    else:
        if ans == '': continue
        ans = ans[:-1]
print(ans)

Submission status: Accepted

Solution code:
s = input()
r = ""
for i in s:
  if i != "B":
    r += i
  if i == "B":
    r = r[:-1]
print(r)

Submission status: Accepted

Solution code:
s = list(input())
S = ''
for i in s:
    if  i == '0' or i == '1':
        S += i
    elif i == 'B' and len(S) != 0:
        S = S[:-1]
print(S)

Submission status: Accepted

Solution code:
s=input()
ans=[]
for i in range(len(s)):
    if s[i]=='0':
        ans.append('0')
    if s[i]=='1':
        ans.append('1')
    if s[i]=='B' and len(ans)>0:
        ans.pop(len(ans)-1)
print(''.join(ans))

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def main():
    S = input()
    ans = []
    for c in S:
        if c == "0":
            ans.append("0")
        elif c == "1":
            ans.append("1")
        else:
            if ans:
                ans.pop()

    print("".join(ans))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
ans = []

for i in range(len(s)):
    if s[i] == "0":
        ans.append("0")
    elif s[i] == "1":
        ans.append("1")
    elif s[i] == "B":
        if ans != []:
            ans.pop()

print("".join(ans))

Submission status: Accepted

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

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

print("".join(a))

Submission status: Accepted

Solution code:
s = input()
t = ""
for i in range(len(s)):
    if s[i] == "0":
        t += "0"
    elif s[i] == "1":
        t += "1"
    else:
        t = t[:-1]

print(t)

Submission status: Accepted

Solution code:
s=input();c=0;t='';
for i in range(len(s)-1,-1,-1):
    if s[i]=='B':c+=1
    else:
        if c>0:c-=1
        else:t=s[i]+t
print(t)

Submission status: Accepted

Solution code:
s = input()

a = []
ans = ""

for i in range(len(s)):
    if s[i] == '0':
        a.append('0')

    elif s[i] == '1':
        a.append('1')

    else:
        if len(a) != 0:
            a.pop()

#print(a)

ans = "".join(a)

print(ans)

Submission status: Accepted

Solution code:
s = str(input())
list = list(s)
count = 0
ans = ""
while count < len(list):
  if list[count] == "B":
    ans = ans[:-1]
  else:
    ans += list[count]
  count += 1
print(ans)

Submission status: Accepted

Solution code:
s = input()
a = ''

for _ in s:
    if _ == 'B':
        a = a[:-1]
    else:
        a += _

print(a)

Submission status: Accepted

Solution code:
S = list(input())
T = []
for i in range(len(S)) :
    if S[i] != "B" :
        T.append(S[i])
    else :
        if len(T) != 0 :
            T.pop(-1)
print("".join(T))

Submission status: Accepted

Solution code:
s = list(input())
output = ""
for i in range(len(s)):
    if s[i] == "B":
        output = output[:-1]
    else:
        output += s[i]
print(output)

Submission status: Accepted

Solution code:
S = input()

ans = []
for ch in S:
  if ch != "B":
    ans.append(ch)
  elif len(ans) > 0:
    ans.pop()
    
print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

ans = ''
for s in S:
    if s == 'B':
        if len(ans) != 0:
            ans = ans[:-1]
    else:
        ans += s
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
a=[]
for i in range(len(s)):
    if s[i]=='0':
        a.append('0')
    elif s[i]=='1':
        a.append('1')
    else:
        if len(a)!=0:
            trash=a.pop()
        else:
            pass
print(''.join(a))

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

s = input()

t = []
for si in s:
    if si != 'B':
        t.append(si)
    elif t != []:
        t.pop()

print(''.join(t))

Submission status: Accepted

Solution code:
s = input()
L = []
for i in range(len(s)):
  if (s[i] == '0'):
    L.append('0')
  elif (s[i] == '1'):
    L.append('1')
  else:
    if (len(L) != 0):
      del L[len(L)-1]
print((''.join(L)))

Submission status: Accepted

Solution code:
s = list(input())
S = []
for i in s:
    if i == "0":
        S.append(0)
    elif i == "1":
        S.append(1)
    elif i == "B":
        if len(S) != 0:
            del S[-1]

for i in S:
    print(i, end = "")
print()

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

Solution code:
def convert_input(input_str):
    result = ''

    for s in input_str:
        if s == 'B':
            result = result[:-1]
        else:
            result += s
    
    return result

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
list = []
for i in s:
    if i == '0':
        list.append('0')
    elif i == 'B':
        if len(list) == 0:
            continue
        else:
            list.pop()
    else:
        list.append('1')
print(''.join(list))

Submission status: Accepted

Solution code:
s = input()
text = ''
for letters in s:
  if letters == 'B':
    if text == '':
      pass
    else:
      text = text[0:-1]
  else:
    text += letters
print(text)

Submission status: Accepted

Solution code:
s=input()
a=[]
for i in range(len(s)):
    if s[i]=="B":
        if a==[]:
            continue
        else:
            del a[-1]
    elif s[i]=="0":
        a.append("0")
    elif s[i]=="1":
        a.append("1")
print("".join(a))

Submission status: Accepted

Solution code:
s = (input())
ans = []
for i in s:
    if i == '0':
        ans.append(0)
    elif i == '1':
        ans.append(1)
    elif i == 'B':
        if len(ans) >= 1:
            del ans[-1]
ans = list(map(str, ans))
print(''.join(ans))

Submission status: Accepted

Solution code:
s=input()
data=[]
for i in range (len(s)):
    if s[i]=='0':
        data.append('0')
    elif s[i]=='1':
        data.append('1')
    else:
        if len(data)==0:
            continue
        else:
            data.pop(len(data)-1)
print(''.join(data))

Submission status: Accepted

Solution code:
s = input()
out = ''

for i in s:
    if i == '0' or i == '1':
        out += i
    elif i == 'B':
        if len(out) > 0:
            out = out[:len(out)-1]

print(out)

Submission status: Accepted

Solution code:
STR = input()
ans = ""
for s in STR:
  if s == "1" or s == "0":
    ans += s
  else:
    if ans == "":
      pass
    else:
      ans = ans[:-1]
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ans = ""
for i in s:
    if i == "0":
        ans += "0"
    elif i == "1":
        ans += "1"
    elif len(ans) > 0:
        ans = ans[:-1]

print(ans)

Submission status: Accepted

Solution code:
ans = ""
s = input()

for i in range(len(s)):
    if s[i] == '0':
        ans = ans + '0'
        
    elif s[i] == '1':
        ans = ans + '1'
        
    elif s[i] == 'B':
        if ans == "":
            pass
        else:
            ans = ans[:-1]
            
print(ans)

Submission status: Accepted

Solution code:
s=input()

res=""
for c in s:
	if c=='B':
		res=res[:-1]
	else:
		res=res+c
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    s = list(input())
    ans = []
    for i in s:
        if i == '0':
            ans.append('0')
        elif i == '1':
            ans.append('1')
        elif i == 'B':
            if len(ans) == 0:
                ans = []
            else:
                ans.pop()
    print(''.join(ans))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = ""
for c in input():
    if c == "0" or c == "1":
        s += c
    elif s:
        s = s[:-1]
print(s)

Submission status: Accepted

Solution code:
text = input()
lis = []
for i in range(len(text)):
    if text[i] == "B" and len(lis) != 0:lis.pop()
    elif text[i] != "B":lis.append(text[i])
print("".join(lis))

Submission status: Accepted

Solution code:
s = list(input())
a = []
for i in s:
  if i == "0":
    a.append("0")
  elif i == "1":
    a.append("1")
  else:
    a = a[:-1]
print("".join(a))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
str = input()
output = ""
for n in str:
    if(n=="0"):
        output+="0"
    elif(n=="1"):
        output+="1"
    elif(n=="B"):
        output = output[:-1]
print(output)

Submission status: Accepted

Solution code:

def main():
    s = list(input())

    while "B" in s:
        b = s.index("B")
        if b != 0:
            s.pop(b-1)
            s.pop(b-1)
        else:
            s.pop(b)

    print("".join(s))


if __name__ == "__main__":
        main()

Submission status: Accepted

Solution code:
ans = ""
for s in input():
  if s == "B":
    ans = ans[:-1]
  else:
    ans += s
print(ans)

Submission status: Accepted

Solution code:
s = input()
r = ''
for i in range(len(s)):
    if s[i] == 'B':
        if len(r) > 0:
            r = r[:-1]
    else:
        r += s[i]
print(r)

Submission status: Accepted

Solution code:
S = input()

ans = []
for s in S:
    if s in ['0', '1']:
        ans.append(s)
    elif len(ans) > 0:
        ans.pop()
print(''.join(ans))

Submission status: Accepted

Solution code:
import sys

s= list(input())

ans = []
for i in s:
    if i == 'B':
        if ans !=[]:            
            ans.pop(-1)
    else:
        ans.append(i)

print("".join(ans))

sys.exit(0)

Submission status: Accepted

Solution code:
S = input()
ans = ''
for s in S:
    if s == 'B':
        if len(ans) > 0:
            ans = ans[0:-1]
    else:
        ans += s
print(ans)

Submission status: Accepted

Solution code:
S = input()

ans = []
for s in S:
    if s in ['0', '1']:
        ans.append(s)
    elif len(ans) > 0:
        ans.pop()
print(''.join(ans))

Submission status: Accepted

Solution code:
s=input()
l=[]
for i in s:
  if i!="B":
    l.append(i)
  else:
    try:
      l.pop(-1)
    except:
      pass
print("".join(l))

Submission status: Accepted

Solution code:
s = input()
list = []
for i in s:
    if i == 'B':
        if list !=[]:            
            list.pop(-1)
    else:
        list.append(i)
for i in list:
    print(i, end="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s= list(input())
a = ''

for i in s:
    if i=='0' or i=='1':
        a=a+i
    else:
        a = a[0:-1]
print(a)

Submission status: Accepted

Solution code:
S = list(input())

ans = []
l = -1

for i in S:
    if i == '0':
        ans.append(i)
        l+=1
    elif i == '1':
        ans.append(i)
        l+=1
    else:
        if l>=0:
            del ans[l]
            l-=1
            
print(''.join(ans))

Submission status: Accepted

Solution code:
a=input()
b=''
for i in a:
    if i=='0':
        b+='0'
    elif i=='1':
        b+='1'
    else :
        b=b[:len(b)-1]
print(b)

Submission status: Accepted

Solution code:
s = input()

text = ""
for s_i in s:
	if s_i == "B":
		text = text[:-1]
	else:
		text += s_i
print(text)

Submission status: Accepted

Solution code:
s=''
for c in input():
  if c=='B':
    s = s[:-1]
  else:
    s += c
print(s)

Submission status: Accepted

Solution code:
S = input()
ans = []

for i in S:
    if i == "0":
        ans.append("0")
    elif i == "1":
        ans.append("1")
    else:
        if len(ans) != 0:
            ans.pop()
            
print("".join(ans))

Submission status: Accepted

Solution code:
S = input()
r = ''
for i in range(len(S)):
    if S[i] == 'B':
        if len(r) != 0:
            r = r[:-1]
    else:
        r += S[i]
print(r)

Submission status: Accepted

Solution code:
s = input()
ans = ''
for i in range(len(s)):
    if s[i] == 'B':
        ans = ans[:-1]
    else:
        ans += s[i]
print(ans)

Submission status: Accepted

Solution code:
k=input()
a=[]
for i in k:
    if i=="B":
        if len(a)>0:
            del a[-1]
    else:
        a.append(i)
s=""
for i in a:
    s+=i
print(s)

Submission status: Accepted

Solution code:
s = input()
ans = ''
for ss in s:
    if ss == '0':
        ans += '0'
    elif ss == '1':
        ans += '1'
    else:
        ans = ans[:-1]
print(ans)

Submission status: Accepted

Solution code:
res=''
for char in input():
    if char == 'B':
        res = res[:len(res)-1]
    else:
        res = res + char
print(res)

Submission status: Accepted

Solution code:
s = raw_input()
res = ''
for t in s:
  if t == '0' or t == '1':
    res += t
  else:
    if res:
      res = res[:-1]
print(res)

Submission status: Accepted

Solution code:
output = []

def key(c):
    global output
    if c == '0':
        output.append('0')
    elif c == '1':
        output.append('1')
    else:
        output = output[:-1]


s = input()
for c in s:
    key(c)


print(''.join(output))

Submission status: Accepted

Solution code:
s = input()
ans = ""
for v in s:
    if v == 'B':
        ans = ans[:-1]
    elif v == '0':
        ans += '0'
    else:
        ans += '1'

print(ans)

Submission status: Accepted

Solution code:
S = input()

r = []
for i in range(len(S)):
    if S[i] == '0':
        r.append('0')
    elif S[i] == '1':
        r.append('1')
    elif S[i] == 'B':
        if len(r) > 0:
            r.pop(-1)

str_r = ""
for _r in r:
    str_r += _r

print(str_r)

Submission status: Accepted

Solution code:
s = list(input())
x = len(s)
seq = ""
for i in range(x):
	if s[i] == "0":
		seq += "0"
	elif s[i] == "1":
		seq += "1"
	else:
		if seq == "":
			pass
		else:
			seq = seq[0:-1]

print(seq)

Submission status: Accepted

Solution code:
N=list(input())
t=[]
for i in N:
    if i=="0":
        t.append("0")
    elif i=="1":
        t.append("1")
    else:
        if t!=[]:
            t.pop(-1)
print("".join(t))

Submission status: Accepted

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

s = input()
ans = ''
for i in s:
    if i == 'B':
        ans = ans[:-1]
    else:
        ans += i
print(ans)

Submission status: Accepted

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

s = input()

def typeStr(ans, str1):
    if str1 == "B":
        # 文字列が空ではない確認
        if ans != "":
            # 残っている時のみ削除を行う(最後の1文字以外を切り取る)
            ans = ans[0:-1]
    else:
        ans += str1
    return ans

ans = ""
for i in range(len(s)):
    ans = typeStr(ans, s[i])

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

s = input()

ans = ""
for i in range(len(s)):

    if s[i] == "0":
        ans += "0"
    
    elif s[i] == "1":
        ans += "1"

    elif s[i] == "B":
        # 文字列が空ではない確認
        if ans != "":
            # 残っている時のみ削除を行う(最後の1文字以外を切り取る)
            ans = ans[0:-1]

print(ans)

Submission status: Accepted

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

s = input()

ans = []
for i in range(len(s)):

    if s[i] == "0":
        ans.append("0")
    
    elif s[i] == "1":
        ans.append("1")

    elif s[i] == "B":
        # リストが空ではない確認
        if ans:
            # 文字列が残っている時のみ削除を行う
            del ans[-1]

print("".join(ans))

Submission status: Accepted

Solution code:
s=input()
ans=[]
for i in range(len(s)):
    if s[i]=='0':
        ans.append('0')
    elif s[i]=='1':
        ans.append('1')
    elif s[i]=='B':
        ans=ans[:-1:]
print("".join(ans))

Submission status: Accepted

Solution code:
s = input()
ans = ''
for s_i in s:
    if s_i == 'B':
        ans = ans[:-1]
    else:
        ans += s_i
print(ans)

Submission status: Accepted

Solution code:
s=input()
while'B'in s:
    s=s[s[0]=='B':].replace('0B','').replace('1B','')
print(s)

Submission status: Accepted

Solution code:
import re
s = input()
for _ in range(s.count('B')):
    s = re.sub('.?B', '', s, 1)
print(s)

Submission status: Accepted

Solution code:
import re
s = input()
for _ in range(s.count('B')):
    s = re.sub('(^|[01])B', '', s)
print(s)