The Seven Percent Solution

Time limit1sMemory limit128 MB

Problem

Uniform Resource Identifiers (URIs) are strings such as http://icpc.baylor.edu/icpc/, mailto:foo@bar.org, ftp://127.0.0.1/pub/linux, or even just readme.txt, used to identify a resource, usually on the Internet or on a local computer. Certain characters are reserved within URIs. If a reserved character is part of an identifier, it must be percent-encoded: replace it with a percent sign followed by two hexadecimal digits that give the ASCII code of the character. The table below lists seven reserved characters and their encodings. Write a program that percent-encodes a string of characters.

CharacterEncoding
" " (space)%20
"!" (exclamation point)%21
"\$" (dollar sign)%24
"%" (percent sign)%25
"(" (left parenthesis)%28
")" (right parenthesis)%29
"\*" (asterisk)%2a

Input

The input contains one or more strings. Each string is 1 to 79 characters long and appears on a line by itself. The end of the input is marked by a line that contains only #. The character # is used solely as the end-of-input marker and never appears anywhere else in the input. A string may contain spaces, but never at its beginning or end, and it never contains two or more consecutive spaces.

Output

For each input string, replace every occurrence of a reserved character from the table above with its percent-encoding, exactly as shown, and print the resulting string on its own line. Note that the encoding of an asterisk is %2a with a lowercase a, not %2A with an uppercase A.