Markleft is a markup notation. Punctuation characters mark the text that a rule applies to.
^ characters is converted to upper case. One^tWo^threE becomes OneTWOthreE.\ characters has a \ inserted before every double quote. Piglet \said "Hello"\ becomes Piglet said \"Hello\".# characters has every number converted to hexadecimal. One run of consecutive digits is one number, a number has at most 6 digits, and the hexadecimal form uses upper case letters and carries no leading zero. #Text with 31 12 and 64# becomes Text with 1F C and 40.< characters is reversed. This <be reversed<odd becomes This desrever ebodd.@ characters is copied verbatim, so markup inside it is ignored. There is therefore no way to put a @ character into the output. This is @\<<#@ verbatim becomes This is \<<# verbatim.Sections may be nested, but the nesting must be proper, the way brackets match. ^aa<bcd<ee^ becomes AADCBEE. The line One #reverse me ^uppercase me # and more^ is illegal because its nesting is improper.
A section closes at the first validly nested markleft character. abc^def^ghi^jkl^mno contains no nesting and becomes abcDEFghiJKLmno. Two sections of the same kind can still nest, and the effect is usually small but not always. ab<cd^ef<gh<ij^kl<mn becomes ablkJIGHFEdcmn.
The innermost section is processed first, so <#31#< becomes F1.
The input is a sequence of lines of markleft text. Each line is at most 100 characters long and is formatted independently of the others. The markup on every line is valid. A line holding only # marks the end of the input.
Print the formatted text of every input line, one line each, in input order. Print nothing for the closing # line.