c='''54515552545455515456547055555566545654495548554855575370515051485150515453705555545755525456537054515551515051485150515450495568'''
def dec_block(block4: str) -> str:
if len(block4) != 4 or not block4.isdigit():
raise ValueError(f"Bad block: {block4!r}")
x = int(block4[:2]) # 52
y = int(block4[2:]) # 49
if a not in "0123456789ABCDEF" or c not in "0123456789ABCDEF":
raise ValueError(f"Bad hex nibble chars from block {block4!r}: {a!r}{c!r}")
if not (0x20 <= b <= 0x7E):
raise ValueError(f"Decoded to non-printable ASCII: {b}")
def dec(cipher: str) -> str:
if len(cipher) % 4 != 0:
raise ValueError("Cipher length must be multiple of 4.")
for i in range(0, len(cipher), 4):
out.append(dec_block(cipher[i:i+4]))
if __name__ == "__main__":