#include<bits/stdc++.h>
using namespace std;

typedef pair<string,int> P;

void init();

string s;
set<char> boin, tyouon;

vector<P> divide(){
  
  vector<P> res;
  
  for(int i=0;i<s.size();i++){
    
    if(i+1<s.size()&&boin.count(s[i])==0&&s[i+1]=='y'){
      string t;
      t+=s[i];
      t+=s[i+1];
      t+=s[i+2];
      res.push_back(P(t, 4));
      i+=2;
    }
    else if(i+1<s.size()&&boin.count(s[i])==0&&boin.count(s[i+1])==0){
      string t;
      t+=s[i];
      res.push_back(P(t, 1));
      t="";
      t+=s[i+1], t+=s[i+2];
      res.push_back(P(t, 4));
      i+=2;
    }
    else if(i+1<s.size()&&s[i]=='n'&&s[i+1]=='\''){
      string t;
      t+=s[i], t+=s[i+1];
      res.push_back(P(t, 2));
      i+=1;
    }
    else if(i+1<s.size()&&s[i]=='n'&&s[i+1]!='y'&&boin.count(s[i+1])==0){
      string t;
      t+=s[i];
      res.push_back(P(t, 2));
      i+=1;
    }
    else if(i+2<s.size()&&boin.count(s[i])==0&&boin.count(s[i+1])==1&&tyouon.count(s[i+2])==1){
      string t;
      t+=s[i], t+=s[i+1];
      res.push_back(P(t, 4));
      t="";
      t+=s[i+2];
      res.push_back(P(t, 3));
      i+=2;
    }
    else if(i+1<s.size()&&boin.count(s[i])==1&&tyouon.count(s[i+1])==1){
      string t;
      t+=s[i];
      res.push_back(P(t, 4));
      t="";
      t+=s[i+1];
      res.push_back(P(t, 3));
      i+=1;
    }
    else{
      int p=i;
      string t;
      if(s[p]=='n'&&p==s.size()-1){
	t+=s[p];
	res.push_back(P(t, 2));
      }else{
	while(1){
	  t+=s[p];
	  if(boin.count(s[p])==1) break;
	  p++;
	}
	res.push_back(P(t, 4));
      }      
      i=p;
    }
    
  }
  
  return res;
}

bool check(string t){
  
  if(t[0]=='k') return true;
  if(t[0]=='s') return true;
  if(t[0]=='t') return true;
  if(t[0]=='h') return true;
  if(t[0]=='p') return true;
  
  return false;
}

void solve(){
  
  vector<P> S=divide();
  
  vector<int> ans(S.size(), 0);

  for(int i=0;i<S.size();i++){
    
    string t=S[i].first;
    int gr=S[i].second;
    
    if(gr!=4) continue;
    
    if(t[t.size()-1]=='i'||t[t.size()-1]=='u'){
      if(check(t)&&i+1<S.size()&&check(S[i+1].first)) ans[i]=1;
      if(check(t)&&i+1==S.size()) ans[i]=1;
    }
    
  }
  
  for(int i=0;i<S.size();i++){
    
    string t=S[i].first;
    int gr=S[i].second;

    if(gr!=4) continue;
    
    if(check(t)&&(t[t.size()-1]=='a'||t[t.size()-1]=='o')){
      
      if(i+1==S.size()) continue;
      
      if(S[i+1].second==4){
	string nt=S[i+1].first;
	if(check(nt)&&nt[nt.size()-1]==t[t.size()-1]) ans[i]=1;
      }
    }
    
  }
  
  int flag=0;
  
  for(int i=0;i<S.size();i++){
    
    string t=S[i].first;
    
    if(boin.count(t[t.size()-1])==1){
      if(flag&&ans[i]) ans[i]=0, flag=0;
      if(ans[i]==0) flag=0;
      if(ans[i]==1) flag=1;
    }
  }
  
  for(int i=0;i<S.size();i++){
    string t=S[i].first;
    if(!ans[i]) cout<<t;
    else{
      cout<<t.substr(0,t.size()-1)<<"("<<t[t.size()-1]<<")";
    }
  }
  cout<<endl;
  
}

int main(){
  
  init();
  
  while(1){
    
    cin>>s;
    if(s=="#") break;
    
    solve();
    
  }
  
  return 0;
}

void init(){
    
  boin.insert('a');
  boin.insert('i');
  boin.insert('u');
  boin.insert('e');
  boin.insert('o');
  
  tyouon.insert('a');
  tyouon.insert('i');
  tyouon.insert('u');
}



Measured memory_bytes: 3172