import sys

# get command line args
hexString = sys.argv[1]

splitSize = 8

words = [hexString[i:i+splitSize] for i in range(0, len(hexString), splitSize)]

little_endian = []
splitSize = 2 # len of byte
for w in words:
    splitByte = [w[i:i+2] for i in range(0, len(w), 2)]
    splitByte = splitByte[::-1]
    for byte in splitByte:
        # convert to little endian and add to str
        little_endian.append(int(byte,16))

#print little_endian
#little_endian = little_endian[::-1]

secret = []
for i in little_endian[:-1]:
    if i % 2 == 0:
        secret.append(((i+2) % 256))
    else:
        secret.append(i)

secret = ''.join([chr(c) for c in secret])
secret += chr(little_endian[-1])
sys.stdout.write(secret)
