# your code goes here
s1 = "諸葛小明台北"
s2 = "諸葛1234台北"
s3 = "諸葛小 台23"
s4 = "諸葛小1 台2 "
def cut_by_big5(s, start=None, end=None):
s = s.encode('big5')
return s[slice(start, end)].decode('big5').encode('utf-8').decode('utf-8')
print(cut_by_big5(s1, 0, 8))
print(cut_by_big5(s1, 8))
print(cut_by_big5(s2, 0, 8))
print(cut_by_big5(s2, 8))
print(cut_by_big5(s3, 0, 8))
print(cut_by_big5(s3, 8))
print(cut_by_big5(s4, 0, 8))
print(cut_by_big5(s4, 8))
IyB5b3VyIGNvZGUgZ29lcyBoZXJlCgpzMSA9ICLoq7jokZvlsI/mmI7lj7DljJciCnMyID0gIuiruOiRmzEyMzTlj7DljJciCnMzID0gIuiruOiRm+WwjyAg5Y+wMjMiCnM0ID0gIuiruOiRm+WwjzEg5Y+wMiAiCgoKZGVmIGN1dF9ieV9iaWc1KHMsIHN0YXJ0PU5vbmUsIGVuZD1Ob25lKToKICAgIHMgPSBzLmVuY29kZSgnYmlnNScpCiAgICByZXR1cm4gc1tzbGljZShzdGFydCwgZW5kKV0uZGVjb2RlKCdiaWc1JykuZW5jb2RlKCd1dGYtOCcpLmRlY29kZSgndXRmLTgnKQoKCnByaW50KGN1dF9ieV9iaWc1KHMxLCAwLCA4KSkKcHJpbnQoY3V0X2J5X2JpZzUoczEsIDgpKQoKcHJpbnQoY3V0X2J5X2JpZzUoczIsIDAsIDgpKQpwcmludChjdXRfYnlfYmlnNShzMiwgOCkpCgpwcmludChjdXRfYnlfYmlnNShzMywgMCwgOCkpCnByaW50KGN1dF9ieV9iaWc1KHMzLCA4KSkKCnByaW50KGN1dF9ieV9iaWc1KHM0LCAwLCA4KSkKcHJpbnQoY3V0X2J5X2JpZzUoczQsIDgpKQo=