# [Python 2], 81 (length) + 250 (penalty) = 331 <!-- language: lang-python --> k=1;m,s=k,k for(c)in(input()*8)[:2:-1]:m,k=m/2+ord(c)*k,k*128;s=m%16%15*s print+s [Try it online!] ### Binary dump 00000000: 011010110011110100110001001110110110110100101100 k=1;m, 00000006: 011100110011110101101011001011000110101100001010 s=k,k. 0000000c: 011001100110111101110010001010000110001100101001 for(c) 00000012: 011010010110111000101000011010010110111001110000 in(inp 00000018: 011101010111010000101000001010010010101000111000 ut()*8 0000001e: 001010010101101100111010001100100011101000101101 )[:2:- 00000024: 001100010101110100111010011011010010110001101011 1]:m,k 0000002a: 001111010110110100101111001100100010101101101111 =m/2+o 00000030: 011100100110010000101000011000110010100100101010 rd(c)* 00000036: 011010110010110001101011001010100011000100110010 k,k*12 0000003c: 001110000011101101110011001111010110110100100101 8;s=m% 00000042: 001100010011011000100101001100010011010100101010 16%15* 00000048: 011100110000101001110000011100100110100101101110 s.prin 0000004e: 011101000010101101110011 t+s [Python 2]: https://docs.python.org/2/ [Try it online!]: https://tio.run/nexus/python2#FYyxCsMgFAB3vyJDw1NjKdo2iMG19Ac6lQ5NakBEDZpA/t6a5bjhOLObCQCK03zwLGvHHJpjwhOxAduwbCsmVJK3EurMP8ozp/1FdDH9akJrTbmQQ9a@5X3L7zSjJdmwdrnUa0ObvsDrCghusuIR4/hNhxgzmkNOzwr4Aw "Python 2 – TIO Nexus"