for([,c]in $=(r=readline)(r(o='')))o+=c.charCodeAt().toString(16) print(c-4?unescape($.replace(/../g,"%$&")):(+c?o+'A':o).toUpperCase())