import java.util.*;
class Main
{
{
Scanner scan
= new Scanner
(System.
in); boolean loop = scan.hasNextLine();
while (loop){
S = scan.nextLine();
if (S.equals("#")) break;
else{
S = S.replace ("%", "%25");
S = S.replace (" ", "%20");
S = S.replace ("!", "%21");
S = S.replace ("$", "%24");
S = S.replace ("(", "%28");
S = S.replace (")", "%29");
S = S.replace ("*", "%2a");
}
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwoKY2xhc3MgTWFpbgp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQlTY2FubmVyIHNjYW4gPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCVN0cmluZyBTOwoJCWJvb2xlYW4gbG9vcCA9IHNjYW4uaGFzTmV4dExpbmUoKTsgCgkJCgkJd2hpbGUgKGxvb3ApewoJCQlTID0gc2Nhbi5uZXh0TGluZSgpOwoJCQlpZiAoUy5lcXVhbHMoIiMiKSkJYnJlYWs7CgkJCWVsc2V7CQoJCQkJUyA9IFMucmVwbGFjZSAoIiUiLCAiJTI1Iik7CgkJCQlTID0gUy5yZXBsYWNlICgiICIsICIlMjAiKTsKCQkJCVMgPSBTLnJlcGxhY2UgKCIhIiwgIiUyMSIpOwoJCQkJUyA9IFMucmVwbGFjZSAoIiQiLCAiJTI0Iik7CgkJCQlTID0gUy5yZXBsYWNlICgiKCIsICIlMjgiKTsKCQkJCVMgPSBTLnJlcGxhY2UgKCIpIiwgIiUyOSIpOwoJCQkJUyA9IFMucmVwbGFjZSAoIioiLCAiJTJhIik7CgkJCQlTeXN0ZW0ub3V0LnByaW50bG4oUyk7CgkJCX0KCQl9Cgl9Cn0K