main = getLine>>= \n->getLine>>=putStrLn.map(read n%)\x0d \x0d r '?'='!'\x0d r '!'='?'\x0d r c=c\x0d \x0d 0%x=r x\x0d n%'Z'=(n-1)%'A'\x0d n%'z' = (n-1)%'a'\x0d n%x|x>'@'&&x<'Z'||x>'`'&&x<'z'=(n-1)%succ x|True=r x
Note that non-ascii characters in the above source code will be escaped (such as \x9f).