```# decode hex# str to list and char to ord
encstr = enc.decode('hex')enclst = [ord(i) for i in list(encstr)]
# in flag, the first 5 is known as 'flag{'# we can use this info to get the key by XORing the first 5 digits# this way we will get our key
init_flag = ['flag{', '}']init_helm1 = map(f, init_flag[0])key1 = [chr(ord(i) ^ j) for i, j in zip(init_helm1, enclst)]flag_coded = ''.join(chr(i ^ ord(j)) for i, j in zip(enclst, scooter(key1)))
all_str = string.ascii_letters + string.digits + '_.,;\'"<>?/{}\|+-=!@#$%^&*'all_str_f = map(f,all_str)
flag_out = ''.join(all_str[all_str_f.index(x)] for x in list(flag_coded))flag_out.replace('J', '_')```