raw = """
##### #### ### #### #####
# # # # # # # # #
##### #### # # # ####
# # # # # # # # #
# # #### ### #### #####
"""
raw_rows = raw.strip().split("\n")
def chunk_it(l, n):
return [l[i:i+n-1] for i in range(0, len(l), n)]
pixels = ["".join(l) for l in zip(*(chunk_it(l, 6) for l in raw_rows))]
# example: A --> "###### ####### ## #"
numeric = [int(s.translate({ord("#"): "1", ord(" "): "0"}),2) for s in pixels]
# example: A --> 33095217
def base36encode(number):
alphabet, base36 = ['0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', '']
while number:
number, i = divmod(number, 36)
base36 = alphabet[i] + base36
return base36 or alphabet[0]
codes = " ".join([base36encode(c) for c in numeric])
print(codes)
cmF3ID0gIiIiCiMjIyMjICMjIyMgICAjIyMgICMjIyMgICMjIyMjCiMgICAjICMgICAjICMgICAjICMgICAjICMgICAgCiMjIyMjICMjIyMgICMgICAgICMgICAjICMjIyMgCiMgICAjICMgICAjICMgICAjICMgICAjICMgICAgCiMgICAjICMjIyMgICAjIyMgICMjIyMgICMjIyMjCiIiIgoKcmF3X3Jvd3MgPSByYXcuc3RyaXAoKS5zcGxpdCgiXG4iKQoKZGVmIGNodW5rX2l0KGwsIG4pOiAKCXJldHVybiBbbFtpOmkrbi0xXSBmb3IgaSBpbiByYW5nZSgwLCBsZW4obCksIG4pXQoKcGl4ZWxzID0gWyIiLmpvaW4obCkgZm9yIGwgaW4gemlwKCooY2h1bmtfaXQobCwgNikgZm9yIGwgaW4gcmF3X3Jvd3MpKV0KIyBleGFtcGxlOiBBIC0tPiAiIyMjIyMjICAgIyMjIyMjIyAgICMjICAgIyIKCm51bWVyaWMgPSBbaW50KHMudHJhbnNsYXRlKHtvcmQoIiMiKTogIjEiLCBvcmQoIiAiKTogIjAifSksMikgZm9yIHMgaW4gcGl4ZWxzXQojIGV4YW1wbGU6IEEgLS0+IDMzMDk1MjE3CgoKZGVmIGJhc2UzNmVuY29kZShudW1iZXIpOgogICAgYWxwaGFiZXQsIGJhc2UzNiA9IFsnMDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaJywgJyddCiAgICB3aGlsZSBudW1iZXI6CiAgICAgICAgbnVtYmVyLCBpID0gZGl2bW9kKG51bWJlciwgMzYpCiAgICAgICAgYmFzZTM2ID0gYWxwaGFiZXRbaV0gKyBiYXNlMzYKICAgIHJldHVybiBiYXNlMzYgb3IgYWxwaGFiZXRbMF0KCmNvZGVzID0gIiAiLmpvaW4oW2Jhc2UzNmVuY29kZShjKSBmb3IgYyBpbiBudW1lcmljXSkKcHJpbnQoY29kZXMpCg==