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-----
01B0

-----Sample Output-----
00

Each time the key is pressed, the string in the editor will change as follows: 0, 01, 0, 00.
[{"code": "from collections import deque\n\nS = input()\n\nans = deque([])\n\nfor s in S:\n    if s==\"B\":\n        if ans:\n            ans.pop()\n    else:\n        ans.append(s)\n        \nprint(\"\".join(ans))", "passed": true, "time": 0.29, "memory": 14280.0, "status": "done"}, {"code": "a = list(input())\n\nb = []\n\nfor i in range(int(len(a))):\n\tt = a[int(i)]\n\tif t == \"0\":\n\t\tb.append(\"0\")\n\telif t == \"1\":\n\t\tb.append(\"1\")\n\telse :\n\t\tif len(b) > 0:\n\t\t\tdel b[-1]\nprint(\"\".join(b))", "passed": true, "time": 0.35, "memory": 14092.0, "status": "done"}, {"code": "s = input()\nn = len(s)\n\nans = []\nfor i in range(n):\n  if s[i] == \"0\":\n    ans.append(\"0\")\n  elif s[i] == \"1\":\n    ans.append(\"1\")\n  else:\n    if ans:\n      ans.pop()\n      \nprint(\"\".join(ans))", "passed": true, "time": 0.16, "memory": 14236.0, "status": "done"}, {"code": "# S\u306e\u5165\u529b\u53d7\u4ed8\nS = input()\n# S\u3092\u9806\u306b\u8aad\u307f\u8fbc\u307fB\u304c\u3042\u3063\u305f\u3068\u304d\u76f4\u524d\u306e\u6587\u5b57\u3068\u4e00\u7dd2\u306b\u6d88\u53bb\nSTR = \"\"\nfor i in S:\n    STR = STR + i\n    if i == \"B\" and STR == \"\":\n        STR = \"\"\n    elif i == \"B\":\n        STR = STR[:len(STR) - 2]\nprint(STR)\n", "passed": true, "time": 0.19, "memory": 14332.0, "status": "done"}, {"code": "s = input()\n\nans = ''\nfor i in range(len(s)):\n    if s[i] == 'B':\n        ans = ans[:-1]\n    else:\n        ans += s[i]\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "S = input()\n\nstack = []\n\nfor s in S:\n    if not stack and s!=\"B\":\n        stack.append(s)\n    elif s==\"B\":\n        if stack:stack.pop()\n        else:continue\n    else:\n        stack.append(s)\nprint(\"\".join(stack))", "passed": true, "time": 0.17, "memory": 14276.0, "status": "done"}, {"code": "binaryKeyboard = list(input())\nans = []\n\nfor i in binaryKeyboard:\n    if i=='0' or i == '1':\n        ans.append(i)\n    else:\n        if len(ans) == 0:\n            continue\n        else:\n            del ans[-1]\nprint((''.join(ans)))\n", "passed": true, "time": 0.17, "memory": 13996.0, "status": "done"}, {"code": "x=input()\nz=''\n\nfor i in x:\n  if i == '0':\n    z= z+i\n  elif i == '1':\n    z= z+i\n  elif i == 'B':\n    z= z[:-1]\n\nprint(z)  ", "passed": true, "time": 0.17, "memory": 14096.0, "status": "done"}, {"code": "buf=''\nfor c in input():\n  if c=='B': buf=buf[:-1]\n  else: buf += c\nprint(buf)", "passed": true, "time": 0.16, "memory": 14088.0, "status": "done"}, {"code": "buf = ''\nstr = input()\nfor i in range(len(str)):\n    if str[i] == 'B':\n        if len(buf) != 0:\n            buf = buf[0:len(buf)-1]\n        else:\n            continue\n    else:\n        buf += str[i]\n\nprint(buf)", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "s = input()\nx = []\nfor i in range(len(s)):\n    if s[i] == \"0\":\n        x.append(\"0\")\n    elif s[i] == \"1\":\n        x.append(\"1\")\n    elif s[i] == \"B\" and len(x) > 0 :\n        x.pop(-1)\nprint(\"\".join(x))", "passed": true, "time": 0.18, "memory": 14292.0, "status": "done"}, {"code": "s = input()\na = \"\"\nfor i in s:\n    if i == \"0\":\n        a+=\"0\"\n    elif i == \"1\":\n        a+=\"1\"\n    else:\n        if a!=\"\":\n            a=a[:-1]\n        \nprint(a)", "passed": true, "time": 0.23, "memory": 14184.0, "status": "done"}, {"code": "s = input()\nans = []\nfor i in range(len(s)):\n    if s[i] == 'B':\n        if ans:\n            ans.pop()\n    else:\n        ans.append(s[i])\nprint((''.join(ans)))\n\n", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "s = input()\n\nans = \"\"\nfor c in s:\n    if c == '0':\n        ans += c\n    elif c == '1':\n        ans += c\n    else: # c == 'B'\n        if ans != \"\":\n            ans = ans[:-1]\n\nprint(ans)", "passed": true, "time": 0.19, "memory": 14284.0, "status": "done"}, {"code": "s=input()\noutput=''\nfor i in s:\n    if i!='B':\n        output+=i\n    elif i=='B':\n        output=output[:-1]\nprint(output)\n", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "a = list(input())\nans = []\nfor i in range(len(a)):\n    if a[i] == '0':\n        ans.append('0')\n    elif a[i] == '1':\n        ans.append('1')\n    elif a[i] == 'B':\n        if ans == []:\n            continue\n        else:\n            ans.pop(-1)\nprint(''.join(ans))", "passed": true, "time": 0.16, "memory": 14288.0, "status": "done"}, {"code": "S = input()\n\nF = []\nfor ch in S:\n  if ch == \"B\": \n    if len(F) > 0:\n      F.pop()\n  else:\n    F.append(ch)\n    \nprint(\"\".join(F))", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "s = list(input())\nw_len = len(s)\nword = []\nfor x in range(w_len):\n  if s[x] == 'B':\n    if word != []:\n      word.pop(-1)\n  else:\n    word.append(s[x])\nresult = ''\nfor y in word:\n  result = result+y\nprint(result)", "passed": true, "time": 0.23, "memory": 14148.0, "status": "done"}, {"code": "s = input()\na = \"\"\nfor i in range(len(s)):\n  if s[i] == \"B\":\n    a = a[:-1]\n  else:\n    a += s[i]\nprint(a)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "a = list(input())\n\nb = []\n\nfor i in range(int(len(a))):\n\tt = a[int(i)]\n\tif t == \"0\":\n\t\tb.append(\"0\")\n\telif t == \"1\":\n\t\tb.append(\"1\")\n\telse :\n\t\tif len(b) > 0:\n\t\t\tdel b[-1]\nprint(\"\".join(b))", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "import math\nfrom math import gcd,pi,sqrt\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\nimport sys\nsys.setrecursionlimit(10**6)\nimport itertools\nimport bisect\nfrom collections import Counter,deque\ndef i_input(): return int(input())\ndef i_map(): return map(int, input().split())\ndef i_list(): return list(i_map())\ndef i_row(N): return [i_input() for _ in range(N)]\ndef i_row_list(N): return [i_list() for _ in range(N)]\ndef s_input(): return input()\ndef s_map(): return input().split()\ndef s_list(): return list(s_map())\ndef s_row(N): return [s_input for _ in range(N)]\ndef s_row_str(N): return [s_list() for _ in range(N)]\ndef s_row_list(N): return [list(s_input()) for _ in range(N)]\n\n\ndef main():\n    S = input()\n    ans = \"\"\n    for i in S:\n        if i != \"\" and i == \"B\":\n            ans = ans[:-1]\n        if i != \"B\":\n            ans = ans + i\n    print(ans)\n   \n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14380.0, "status": "done"}, {"code": "s = str(input())\na = []\n \nfor i in range(len(s)):\n    if s[i] == '0':\n        a.append('0')\n    elif s[i] == '1':\n        a.append('1')\n    else:\n        if len(a) != 0:\n            a.pop()\n \nprint(''.join(a))", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "s = list(input())\nli = []\nfor i in s:\n    if i == '0':\n        li.append('0')\n    elif i == '1':\n        li.append('1')\n    elif i == 'B':\n        if li == []:\n            pass\n        else:\n            li.pop(-1)\nprint(''.join(li))", "passed": true, "time": 0.15, "memory": 14204.0, "status": "done"}, {"code": "binaryKeyboard=list(input())\nans=[]\nfor i in binaryKeyboard:\n  if i==\"0\" or i==\"1\":\n    ans.append(i)\n  else:\n    if len(ans)==0:\n      continue\n    else:\n      del ans[-1]\nprint(''.join(ans))", "passed": true, "time": 0.15, "memory": 14036.0, "status": "done"}, {"code": "S=list(input())\n\nans=[]\n\nfor s in S:\n  if s == \"B\":\n    if len(ans)>0:\n      del ans[-1]\n  else:\n    ans.append(s)\n    \nprint(\"\".join(ans))", "passed": true, "time": 0.23, "memory": 14308.0, "status": "done"}, {"code": "s = str(input())\na = []\n\nfor i in range(len(s)):\n    if s[i] == '0':\n        a.append('0')\n    elif s[i] == '1':\n        a.append('1')\n    else:\n        if len(a) != 0:\n            a.pop()\n\nprint(''.join(a))", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "n=[]\nfor i in input():\n  if i=='B':\n    if n: n.pop()\n  else:\n    n.append(i)\nprint(*n,sep='')", "passed": true, "time": 0.15, "memory": 14224.0, "status": "done"}, {"code": "S = input()\nans = \"\"\nfor s in S:\n    if s == \"B\":\n        if ans:\n            ans = ans[:-1]\n    else:\n        ans += s\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "s=list(input())\nans=list()\nfor i in s:\n    if i==\"0\":\n        ans.append(0)\n    elif i==\"1\":\n        ans.append(1)\n    else:\n        try:\n            ans.pop(-1)\n        except:\n            pass\nfor i in ans:\n    print(i,end=\"\")\nprint()", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "s=input()\na=''\n\nfor i in s:\n  if i=='B':\n    a=a[:-1]\n    \n  else:\n    a+=i\nprint(a)\n", "passed": true, "time": 0.23, "memory": 14220.0, "status": "done"}, {"code": "def handle_string(string):\n    new_string = ''\n    for i in range(len(string)):\n        if string[i]=='B':\n            if len(new_string)!=0:\n                new_string = new_string[0:len(new_string)-1]\n            else:\n                continue\n        else:\n            new_string = new_string+string[i]\n    return new_string\ninput_string = input()\nprint(handle_string(input_string))", "passed": true, "time": 0.38, "memory": 14356.0, "status": "done"}, {"code": "n = input()\na = \"\"\nfor i in n:\n  if i ==\"0\":\n    a+=i\n  elif i ==\"1\":\n    a+=i\n  elif i ==\"B\":\n    a = a[:-1]\nprint(a)", "passed": true, "time": 0.39, "memory": 14056.0, "status": "done"}, {"code": "s = list(input())\nx = len(s)\na = []\n\nfor i in range(x):\n  if s[i] == '0':\n    a.append('0')\n  elif s[i] == '1':\n    a.append('1')\n  elif s[i] == 'B':\n    if a == []:\n      continue\n    else:\n      a.pop(-1)\nb = ''.join(a)\nprint(b)", "passed": true, "time": 0.67, "memory": 14308.0, "status": "done"}, {"code": "s=input()\ndata=[]\nfor i in range(len(s)):\n  if s[i]=='0':\n    data.append('0')\n  elif s[i]=='1':\n    data.append('1')\n  else:\n    if len(data)==0:\n      continue\n    else:\n      data.pop()\nprint(*data,sep='')", "passed": true, "time": 0.15, "memory": 14220.0, "status": "done"}, {"code": "n = \"\"\ncommand = input()\nfor i in command:\n  if i == \"B\":\n    n=n[:-1]\n  else:\n    n+=i\nprint(n)", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\nS = input()\nret = ''\nfor i in range(len(S)):\n    if S[i] == '0': ret += '0'\n    elif S[i] == '1': ret += '1'\n    else: ret = ret[:-1]\n\nprint(ret)\n", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "s=input()\nans=''\nfor c in s:\n  if c=='0':\n    ans+='0'\n  elif c=='1':\n    ans+='1'\n  else:\n    ans=ans[:len(ans)-1]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "s = str(input())\nans = \"\"\nfor i in range(len(s)):\n  if(s[i]!=\"B\"):\n    ans += s[i]\n  else:\n    if(ans != \"\"):\n      ans = ans[:-1]\nprint(ans)\n\n", "passed": true, "time": 0.25, "memory": 14112.0, "status": "done"}, {"code": "#!/usr/bin/env python3\ns = input()\nlen_s = len(s)\n\ntext = ''\nfor i in range(len_s):\n    if s[i] == '0':\n        text += '0'\n    elif s[i] == '1':\n        text += '1'\n    else:\n        if text == '':\n            pass\n        else:\n            text = text[:-1]\nprint(text)\n", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "key = list(input())\nans = []\n\nfor i in key:\n    if i == '0' or i == '1':\n        ans.append(i)\n    elif len(ans) == 0:\n        continue\n    else:\n        del ans[-1]\n\nprint(''.join(ans))", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "s=input()\nans=''\nfor i in s:\n  if i!='B':\n    ans+=i\n  else:\n    ans=ans[:-1]\nprint(ans)", "passed": true, "time": 0.26, "memory": 14228.0, "status": "done"}, {"code": "s = input()\nans = ''\nfor i in range(len(s)):\n    if s[i] == '0':\n        ans += '0'\n        \n    elif s[i] == '1':\n        ans += '1'\n        \n    else:\n        if ans != '':\n            ans = ans[:-1]\n            \nprint(ans)", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "from collections import deque\n\n\ndef main():\n    ss = list(input())\n    ans = deque([])\n    for s in ss:\n        if s == '0':\n            ans.append(s)\n        elif s == '1':\n            ans.append(s)\n        else:\n            if len(ans) == 0:\n                pass\n            else:\n                ans.pop()\n    print(*list(ans), sep='')\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.19, "memory": 14312.0, "status": "done"}, {"code": "s = input()\n\nout =''\nfor x in s:\n    if x != 'B':\n        out += x\n    else:\n        if out == '':\n            continue\n        else:\n            out = out[:-1]\nprint(out)", "passed": true, "time": 0.2, "memory": 14224.0, "status": "done"}, {"code": "from sys import stdin\ninput = stdin.readline\n\nS = input().strip()\nP = ''\nfor s in S:\n    if s == 'B':\n        if P != '':\n            P = P[:-1]\n    else:\n        P = P + s\nprint(P)", "passed": true, "time": 0.15, "memory": 14312.0, "status": "done"}, {"code": "first_str =input()\n\ninput_list = list(first_str)\n\ntotal_list = list()\n\nfor i in input_list:\n    if i == \"0\":\n        total_list.append(\"0\")\n        \n    elif i == \"1\":\n        total_list.append(\"1\")\n    \n    else:\n        if not total_list:\n            pass\n        else:\n            total_list.pop(-1)\n    \ntotal = \"\".join([str(_) for _ in total_list])\nprint(total)", "passed": true, "time": 0.22, "memory": 14064.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\nS = list(input())\nans = []\n\nfor i in range(len(S)):\n    if S[i] == 'B':\n        if len(ans) == 0:\n            continue\n        else:\n            ans.pop()\n    else:\n        ans.append(S[i])\n\nfor i in range(len(ans)):\n    print(ans[i] , end = \"\")\n\nprint()\n\n", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "import sys\n\nsys.setrecursionlimit(10 ** 8)\nini = lambda: int(sys.stdin.readline())\ninl = lambda: [int(x) for x in sys.stdin.readline().split()]\nins = lambda: sys.stdin.readline().rstrip()\ndebug = lambda *a, **kw: print(\"\\033[33m\", *a, \"\\033[0m\", **dict(file=sys.stderr, **kw))\n\n\ndef solve():\n    s = ins()\n    x = []\n    for c in s:\n        if c in \"01\":\n            x.append(c)\n        elif x:\n            x.pop()\n    return \"\".join(x)\n\n\nprint(solve())\n", "passed": true, "time": 0.22, "memory": 14324.0, "status": "done"}, {"code": "s = input()\nans = ''\n\nfor char in s:\n    if char == '0':\n        ans += '0'\n    if char == '1':\n        ans += '1'\n    if char == 'B':\n        ans = ans[:-1]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "S = input()\n\nans = ''\nfor s in S:\n    if s == '0':\n        ans+='0'\n    elif s == '1':\n        ans += '1'\n    else:\n        if len(ans)>0:\n            ans = ans[:-1]\nprint(ans)\n", "passed": true, "time": 0.18, "memory": 14064.0, "status": "done"}, {"code": "s = input()\nans = ''\nfor c in s:\n    if c == '0':\n        ans += '0'\n    elif c == '1':\n        ans += '1'\n    else:\n        ans = ans[:len(ans) - 1]\nprint(ans)", "passed": true, "time": 0.23, "memory": 14080.0, "status": "done"}, {"code": "s = list(input())\nans = []\nfor i in range(len(s)) :\n    if s[i] == \"0\" :\n        ans.append(\"0\")\n    elif s[i] == \"1\" :\n        ans.append(\"1\")\n    elif s[i] == \"B\" and len(ans) > 0 :\n        del ans[-1]\nprint((\"\".join(ans)))\n", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nimport sys\n\n\ndef solve(s: str):\n    a = []\n    for c in s:\n        if c == \"B\":\n            if a:\n                a.pop()\n        else:\n            a.append(c)\n    return \"\".join(a)\n\n\n# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools\ndef main():\n    def iterate_tokens():\n        for line in sys.stdin:\n            for word in line.split():\n                yield word\n    tokens = iterate_tokens()\n    s = next(tokens)  # type: str\n    print((solve(s)))\n\ndef test():\n    import doctest\n    doctest.testmod()\n\ndef __starting_point():\n    #test()\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "s = [ss for ss in str(input())]\nans = []\nfor i in s:\n    if i == \"0\" or i == \"1\":\n        ans.append(i)\n    elif len(ans) > 0:\n        ans.pop(-1)\nprint(\"\".join(ans))", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "def main():\n    s = str(input())\n\n    ans = []\n    for val in s :\n        if val == \"B\" and ans == [] :\n            pass\n        elif val == \"B\" and ans != [] :\n            ans.pop(-1)\n        else :\n            ans.append(val)\n\n    ans_str = \"\"\n    for val in ans :\n        ans_str = ans_str + val\n\n    print(ans_str)\n\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.19, "memory": 14096.0, "status": "done"}, {"code": "s = input()\nl = []\nfor i in range(len(s)):\n    if s[i] == '0':\n        l.append('0')\n    elif s[i] == '1':\n        l.append('1')\n    else:\n        if l == []:\n            continue\n        else:\n            del l[-1]\nprint((''.join(l)))\n", "passed": true, "time": 0.15, "memory": 14332.0, "status": "done"}, {"code": "s = input()\nans = []\n\nfor i in s:\n    if i=='B':\n        if ans != []:\n            ans.pop(-1)\n    else:\n        ans.append(i)\nprint(''.join(ans))", "passed": true, "time": 0.15, "memory": 14308.0, "status": "done"}, {"code": "n = input()\nstr = ''\nfor i in n:\n  if i == '0' or i == '1':\n    str = str + i\n  if i == 'B':\n    str = str[:-1]\n    \nprint(str)", "passed": true, "time": 0.15, "memory": 14280.0, "status": "done"}, {"code": "s = input()\nans = []\nfor i in s:\n  if i == \"0\":\n    ans.append(0)\n  elif i == \"1\":\n    ans.append(1)\n  else:\n    if len(ans) != 0:\n      ans.pop(-1)\nprint(*ans,sep=\"\")", "passed": true, "time": 0.31, "memory": 14084.0, "status": "done"}, {"code": "s = input()\n\nans=\"\"\n\nfor i in range(len(s)):\n    if s[i]==\"B\":\n        ans = ans[:-1]\n    else:\n        ans+=s[i]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "from collections import deque\nd = deque()\nfor c in input():\n  if c != 'B': d.append(c) \n  elif len(d) != 0: d.pop()\nprint(*d, sep='')", "passed": true, "time": 0.43, "memory": 14184.0, "status": "done"}, {"code": "s = input()\nans = ''\nfor i in range(len(s)):\n\tif s[i] == '0':\n\t\tans += '0'    \n\telif s[i] == '1':\n\t\tans += '1'    \n\telse:\n\t\tif ans != '':\n\t\t\tans = ans[:-1]    \nprint(ans)", "passed": true, "time": 0.28, "memory": 14048.0, "status": "done"}, {"code": "# cook your dish here\ns = str(input())\na = \"\"\nfor i in s:\n  if i!='B':\n    a = a + i\n  else:\n    if len(a)!=0:\n      a = a[0:len(a)-1]\nprint(a)", "passed": true, "time": 0.32, "memory": 14228.0, "status": "done"}, {"code": "s = input()\na = []\nfor c in s:\n    if c in ['0', '1']:\n        a.append(c)\n    else:\n        if len(a) != 0:\n            a.pop()\nprint(''.join(a))", "passed": true, "time": 0.31, "memory": 14028.0, "status": "done"}, {"code": "s = input()\nnumB = 0\nr = \"\"\nfor i in range(len(s))[::-1]:\n  if s[i] == \"B\":\n    numB = numB+1\n    continue\n  if numB > 0 and (s[i]==\"0\" or s[i]==\"1\"):\n    numB = numB-1\n    continue\n  r = r + s[i]\n\nprint((''.join(list(reversed(r)))))\n\n", "passed": true, "time": 0.42, "memory": 14152.0, "status": "done"}, {"code": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# FileName: \tB\n# CreatedDate:  2020-10-03 20:05:16 +0900\n# LastModified: 2020-10-03 20:28:14 +0900\n#\n\n\nimport os\nimport sys\n# import numpy as np\n# import pandas as pd\n\n\ndef main():\n    S = input()\n    stack = []\n    for s in S:\n        if s == '0' or s == '1':\n            stack.append(s)\n        elif s == 'B' and stack:\n            stack.pop()\n    for sta in stack:\n        print(sta, end=\"\")\n    print()\n\n\n\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "s=input()\nres=\"\"\nfor i in s:\n    if i!=\"B\":\n        res+=i\n    else:\n        res=res[:len(res)-1]\nprint(res)", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "s = input()\nlis = []\nfor c in s:\n    if c == 'B':\n        if len(lis):\n            lis = lis[:-1]\n        else:\n            continue\n    else:\n        lis.append(int(c))\n\nfor i in lis:\n    print(i, end=\"\")\nprint()", "passed": true, "time": 0.15, "memory": 14092.0, "status": "done"}, {"code": "i = input()\nans = \"\"\nfor s in i:\n  if s != \"B\":\n    ans += s\n  else:\n    ans = ans[:-1]\n  \nprint(ans)", "passed": true, "time": 0.21, "memory": 14264.0, "status": "done"}, {"code": "import math\nfrom datetime import date\n\ndef main():\n\t\t\n\ts = input()\n\tans = []\n\n\tfor c in s:\n\t\tif c != 'B':\n\t\t\tans.append(c)\n\t\telse:\n\t\t\tif len(ans) != 0:\n\t\t\t\tans.pop();\n\n\tline = \"\"\n\tfor c in ans:\n\t\tline += c\n\n\tprint(line)\n\t\nmain()\n", "passed": true, "time": 0.16, "memory": 16384.0, "status": "done"}, {"code": "#!/usr/bin/env python3\ns=input()\nans=[]\nfor i in s:\n    if i=='0' or i=='1':\n        ans.append(i)\n    else:\n        if len(ans):\n            ans.pop()\nprint(''.join(ans))", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "s=input()\nfin=\"\"\nfor c in s:\n    if c=='1':\n        fin+=\"1\"\n    elif c=='0':\n        fin+=\"0\"\n    else:\n        if len(fin)>0:\n            fin=fin[:-1]\nprint(fin)\n", "passed": true, "time": 0.16, "memory": 14196.0, "status": "done"}, {"code": "a = input()\ntest = ''\nfor i in range(len(a)):\n  if a[i] == '0':\n    test += '0'\n  elif a[i] == '1':\n    test += '1'\n  else:\n    if len(a) == 0:\n      pass\n    else:\n      test = test[:-1]\n    \nprint(test)", "passed": true, "time": 0.15, "memory": 14188.0, "status": "done"}, {"code": "s = str(input())\nans = []\nfor i in range(len(s)):\n    if s[i] == \"B\":\n        if len(ans) != 0: ans.pop()\n    else : ans.append(s[i])\nprint(''.join(ans))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "s = input()\nS = \"\"\nfor i in s:\n  if i == \"B\":\n    S = S[:-1]\n  else:\n    S += i\nprint(S)", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "s = input()\nans = \"\"\nfor i in s:\n    if i == 'B':\n        if ans != \"\":\n            ans = ans[:-1]\n    else:\n        ans += i\nprint(ans)", "passed": true, "time": 0.14, "memory": 14016.0, "status": "done"}, {"code": "s=input()\nans=\"\"\nfor c in s:\n  if c=='B':\n    if ans:\n      ans=ans[0:-1]\n  else:\n    ans+=c\nprint(ans)", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "s = input()\nans = \"\"\nfor char in s:\n    if char == 'B':\n        if ans == \"\":\n            pass\n        else:\n            l = len(ans)\n            ans = ans[0:l-1]\n    else:\n        ans += char\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "# https://atcoder.jp/contests/abc043/tasks/abc043_b\n\n\"\"\"\n\u53cc\u65b9\u5411\u30ad\u30e5\u30fc\u3092\u3064\u304b\u3063\u3066\u5b9f\u88c5\u3059\u308b\n\n\u3053\u306e\u3069\u308c\u304b\u306e\u64cd\u4f5c\u304c\u3067\u304d\u308b\n* 0 \u3092\u30ad\u30e5\u30fc\u306b\u5165\u308c\u308b\n* 1 \u3092\u30ad\u30e5\u30fc\u306b\u5165\u308c\u308b\n* \u30ad\u30e5\u30fc\u306e\u6700\u5f8c\u306e\u3082\u306e\u3092\u51fa\u3059\n\n\u6ce8\u610f: \u30ad\u30e5\u30fc\u304c\u7a7a\u306e\u5834\u5408\u306b\u30d0\u30c3\u30af\u30b9\u30da\u30fc\u30b9\u3092\u3057\u3066\u3082\u4f55\u3082\u8d77\u304d\u306a\u3044\u3088\u3046\u306b\u3059\u308b\n\"\"\"\n\nfrom collections import deque\n\nq = deque()\n\ns = input()\nfor operation in s:\n    if operation == \"0\":\n        # \u53f3\u7aef\u306b0\u3092\u8ffd\u52a0\n        q.append(\"0\")\n\n    elif operation == \"1\":\n        # \u53f3\u7aef\u306b1\u3092\u8ffd\u52a0\n        q.append(\"1\")\n\n    elif operation == \"B\":\n        # \u30d0\u30c3\u30af\u30b9\u30da\u30fc\u30b9\n        # \u53f3\u7aef\u3092\u4e00\u3064\u524a\u9664\n        # q \u306e\u4e2d\u8eab\u304c\u7a7a\u3067\u3082\u30a8\u30e9\u30fc\u306b\u306a\u3089\u306a\u3044\u3088\u3046\u306b\u4f8b\u5916\u51e6\u7406\n        try:\n            q.pop()\n        except IndexError:\n            pass # \u4f55\u3082\u3057\u306a\u3044\n\n# \u30ad\u30e5\u30fc\u306e\u4e2d\u8eab\u3092\u9806\u756a\u306b\u53d6\u308a\u51fa\u3057\u3066\u6587\u5b57\u5217\u306b\u5909\u63db\nanswer = \"\"\nfor i in q:\n    answer = answer + i\n\nprint(answer)\n", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "s=str(input())\n\nl=[]\nfor i in s:\n  if i==\"0\" or i==\"1\":\n    l.append(i)\n  elif i==\"B\" and len(l)!=0:\n    l.pop(len(l)-1)\n    \nprint(*l,sep='')\n      ", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "import math\nimport collections\nii = lambda : int(input())\nmi = lambda : map(int,input().split())\nli = lambda : list(map(int,input().split()))\n\ns = input()\n\nans = ''\nfor i in range(len(s)):\n    if s[i] == 'B':\n        if len(ans) == 0: continue\n        ans = ans[0:-1]\n    else:\n        ans += s[i]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "s = input()\nans = []\nfor i in range(len(s)):\n  if s[i] == \"B\":\n    if len(ans) != 0:\n      ans.pop()\n  else:\n    ans.append(s[i])\nprint(\"\".join(ans))", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "s = input()\nans = ''\n\nfor i in range(len(s)):\n    if s[i] != 'B':\n        ans += s[i]\n    else:\n        ans = ans[:-1]\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "s = input()\nL = []\nfor x in s:\n    if x == \"0\":\n        L.append(\"0\")\n    elif x == \"1\":\n        L.append(\"1\")\n    else:\n        if len(L) >= 1:\n            del L[-1]\nprint(\"\".join(L))", "passed": true, "time": 0.24, "memory": 14156.0, "status": "done"}, {"code": "def answer(s: str) -> str:\n    result = ''\n    for c in s:\n        if c == 'B':\n            result = result[:-1]\n        else:\n            result += c\n\n    return result\n\ndef main():\n    s = input()\n    print((answer(s)))\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "s = input()\nans = \"\"\nfor char in s:\n    if char != 'B':\n        ans += char\n    else:\n        if ans == \"\":\n            pass\n        else:\n            le = len(ans)\n            ans = ans[0:le - 1]\nprint(ans)\n", "passed": true, "time": 0.18, "memory": 14188.0, "status": "done"}, {"code": "s = input()\nans = \"\"\nfor i in s:\n  if i == \"B\":\n    ans = ans[:-1]\n  else:\n    ans += i\nprint(ans)", "passed": true, "time": 0.24, "memory": 14332.0, "status": "done"}, {"code": "s = input()\nst = []\nfor e in s:\n  if e == 'B':\n    if len(st) != 0:\n      st.pop()\n  else:\n    st.append(int(e))\nprint((''.join(map(str,st))))\n", "passed": true, "time": 0.58, "memory": 14192.0, "status": "done"}, {"code": "s = list(input())\nres = []\nfor i in range(len(s)):\n  if s[i] == \"1\":\n    res.append(\"1\")\n  elif s[i] == \"0\":\n    res.append(\"0\")\n  else:\n    if res == []:\n      continue\n    else:\n      del res[-1]\n\nprint(\"\".join(res))", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "a = input()\nb = ''\nfor elem in a:\n  if elem == '1':\n    b +='1'\n  elif elem == '0':\n    b += '0'\n  else:\n    b = b[:-1]\nprint(b)", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "s = input()\nans = ''\nfor c in s:\n    if c == '0':\n        ans += '0'\n    elif c == '1':\n        ans += '1'\n    elif c == 'B' and ans:\n        ans = ans[:-1]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "s = input()\nans = ''\n\nfor c in s:\n    if c != 'B':\n        ans += c\n    else:\n        ans = ans[:-1]\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14092.0, "status": "done"}, {"code": "s=input()\na=\"\"\nfor i in range(len(s)):\n    if s[i]==\"0\":\n        a+=\"0\"\n    elif s[i]==\"1\":\n        a+=\"1\"\n    else:\n        if a!=\"\":\n            a=a[:-1]\nprint(a)", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "s = input()\nans = \"\"\nfor _ in range(len(s)):\n    if s[0] == \"0\":\n        ans += \"0\"\n        s = s[1:]\n    elif s[0] == \"1\":\n        ans += \"1\"\n        s = s[1:]\n    else:\n        s = s[1:]\n        ans = ans[:-1]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "\nopperations = list(input())\ndisplay_stack = []\nfor opperation in opperations:\n    if opperation == \"B\":\n        if display_stack:\n            display_stack.pop()\n    else:\n        display_stack.append(opperation)\nprint(''.join(display_stack))", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "s = input()\nres = \"\"\nfor i in range(len(s)):\n    if s[i] == \"1\" or s[i] == \"0\":\n        res += s[i]\n    elif s[i] == \"B\" and len(res) != 0:\n        res = res[:-1]\n\nprint(res)\n", "passed": true, "time": 0.15, "memory": 14136.0, "status": "done"}]