#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>

using namespace std;

bool isBoin(char ch){
    return ch=='a'||ch=='i'||ch=='u'||ch=='e'||ch=='o';
}
bool isAIU(char ch){
    return ch=='a'||ch=='i'||ch=='u';
}
bool isNoVoice(char ch,char prv){
    if(ch=='k'||ch=='s'||ch=='t'||ch=='h'||ch=='p')return true;
    else if(ch=='y'){
        ch=prv;
        if(ch=='k'||ch=='s'||ch=='t'||ch=='h'||ch=='p')return true;
    }
    return false;
}
bool isIU(char ch){
    return ch=='i'||ch=='u';
}

bool oks[101];
int main(){
    string s;
    while(cin>>s&&s!="#"){
        memset(oks,0,sizeof(oks));
        vector<string> vs;
        for(int i=0;i<s.size();i++){

            // ¹Ìê
            if(s[i]=='n'&&(i+1==s.size()||(s[i+1]=="'"[0]||!isBoin(s[i+1])))){
                vs.push_back("n");
                if(i+1<s.size()&&s[i+1]=="'"[0]){
                    vs.push_back("'");
                    i++;
                }
            }
            else if(i+2<s.size()&&s[i]!='y'&&s[i]!='w'&&!isBoin(s[i])&&s[i+1]=='y'&&isBoin(s[i+2])){
                vs.push_back(s.substr(i,3));
                i+=2;
            }
            // ê¹Ìê
            else if(isBoin(s[i])){
                vs.push_back(s.substr(i,1));
            }
            // £¹
            else if(i+2<s.size()&&s[i]==s[i+1]){
                string tmp;
                tmp+=s[i];
                vs.push_back(tmp);
                vs.push_back(s.substr(i+1,2));
                i+=2;
            }
            // ·¹
            else if(i+2<s.size()&&isAIU(s[i])&&isAIU(s[i+1])){
                vs.push_back(s.substr(i,2));
                string tmp;
                tmp+=s[i+2];
                vs.push_back(tmp);
                i+=2;
            }
            else{
                vs.push_back(s.substr(i,2));
                i++;
            }
        }
        int pos=0;
        bool isOk=true;
        for(int i=0;i<vs.size();i++){
            // ¡Ìq¹ªðð½·ÈçAê¹ð³º»
            if(vs[i].size()>=2){
                char ch;
                int a=vs[i].size()-2+pos-1;
                if(a<0){
                    ch=' ';
                }
                else{
                    ch=s[vs[i].size()-2+pos-1];
                }
                if(isNoVoice(vs[i][vs[i].size()-2],ch)
                    &&(i==vs.size()-1
                    ||(vs[i+1].size()==1&&isNoVoice(s[pos+vs[i].size()],' '))
                    ||(vs[i+1].size()>=2&&isNoVoice(vs[i+1][vs[i+1].size()-2],s[pos+vs[i].size()])))){
                    if(isIU(vs[i][vs[i].size()-1])&&isOk){
                        oks[i]=true;
                        isOk=false;
                    }
                }
                if(i+1<vs.size()&&vs[i].size()>=2&&vs[i+1].size()>=2){
                    char ch;
                    int a=vs[i].size()-2+pos-1;
                    if(a<0){
                        ch=' ';
                    }
                    else{
                        ch=s[vs[i].size()-2+pos-1];
                    }
                    bool con=isNoVoice(vs[i][vs[i].size()-2],ch)&&isNoVoice(vs[i+1][vs[i+1].size()-2],s[pos+vs[i].size()]);
                    char ch1,ch2;
                    ch1=vs[i][vs[i].size()-1];
                    ch2=vs[i+1][vs[i+1].size()-1];
                    if(!(!con||!((ch1=='a'&&ch2=='a')||(ch1=='o'&&ch2=='o')))&&isOk){
                        oks[i]=true;
                        isOk=false;
                    }
                }
            }
            bool iseb=false;
            for(int j=0;j<vs[i].size();j++)if(isBoin(vs[i][j]))iseb=true;
            // ¡ñÌê¹ª³º»³êÈ©Á½ê,isOkðtrueÉ
            if(!oks[i]&&iseb)isOk=true;
            pos+=vs[i].size();
        }
        for(int i=0;i<vs.size();i++){
            if(oks[i]){
                if(vs[i].size()==2)
                    cout<<vs[i][0]<<'('<<vs[i][1]<<')';
                else cout<<vs[i][0]<<vs[i][1]<<'('<<vs[i][2]<<')';
            }
            else cout<<vs[i];
        }
        cout<<endl;
    }

    return 0;
}

Measured memory_bytes: 0