#include<iostream>
#include<string>
#include<unordered_map>
using namespace std;
int main(){
unordered_map<char, string> mp;
mp[' '] = "%20";
mp['!'] = "%21";
mp['$'] = "%24";
mp['%'] = "%25";
mp['('] = "%28";
mp[')'] = "%29";
mp['*'] = "%2a";
string str;
while(getline(cin, str)){
if(str == "#") break;
string res;
for(auto c :str){
if(mp.count(c) == 1) res += mp[c];
else res += c;
}
cout<<res<<endl;
}
return 0;
}