#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define EACH(t,i,c) for(t::iterator i=(c).begin(); i!=(c).end(); ++i)
const double EPS = 1e-10;
const double PI  = acos(-1.0);

bool isBoin(char c){
	return(c=='a'||c=='i'||c=='u'||c=='e'||c=='o');
}
bool isMuseiShiin(char c){
	return(c=='k'||c=='s'||c=='t'||c=='h'||c=='p');
}
bool isIU(char c){
	return(c=='i'||c=='u');
}
bool isAO(char c){
	return(c=='a'||c=='o');
}
bool isMuseiShiinEnhanced(string &s, int i){
	return isMuseiShiin(s[i])||(i>0&&isMuseiShiin(s[i-1])&&s[i]=='y');
}

int main(){
	string s;
	while(cin>>s,s!="#"){
		vi boin;
		REP(i,s.size()){
			if(isBoin(s[i])){
				boin.push_back(i);
			}
		}
		vi museiBoin(s.size());

		//テヲツッツ催ゥツ淞ウテ」ツ?景テ」ツ?催」ツ?蛍テ」ツ?催」ツ?ョテァツ淞ュテゥツ淞ウテ」ツ?ォテ」ツ?、テ」ツ??」ツ?ヲテッツシツ古」ツ?敕」ツ?ョテヲツッツ催ゥツ淞ウテ」ツ?古ァツ?。テ・ツ」ツーテ・ツュツ静ゥツ淞ウテ」ツ?ォテ」ツ?ッテ」ツ?陛」ツ?セテ」ツつ古」ツ?淌」ツ?ィテ」ツ?催ッツシツ古」ツ?セテ」ツ?淌」ツ?ッテァツ?。テ・ツ」ツーテ・ツュツ静ゥツ淞ウテ」ツ?ョテァツ崢エテ・ツセツ古」ツ?ァテ」ツ?療」ツ?凝」ツつづィツェツ榲・ツ渉・テ」ツ?ョテヲツ慊ォテ・ツーツセテ」ツ?ォテ」ツ?づ」ツつ凝」ツ?ィテ」ツ?催ッツシツ?
		//テ」ツ?禿」ツ?ョティツヲツ湘・ツ可?」ツ?ッテッツシツ古ヲツッツ催ゥツ淞ウテ」ツ?景テ」ツ?催」ツ?蛍テ」ツ?催」ツ?ョテァツ崢エテ・ツセツ古」ツ?ョテヲツ仰催」ツ?古、ツソツεゥツ淞ウテ」ツ?ァテ」ツ?づ」ツ?」テ」ツ?ヲテ」ツつづゥツ?ゥテァツ板ィテ」ツ?陛」ツつ古」ツつ凝ッツシツ偲、ツサツ・テ、ツクツ凝」ツ?ォテ」ツ??」ツ?湘」ツ?、テ」ツ?凝」ツ?ョテ、ツセツ凝」ツつ津ァツ、ツコテ」ツ?凖ッツシツ?
		REP(i,boin.size()){
			int ii=boin[i];
			if(isIU(s[ii])&&
				((ii>0&&ii+1<s.size()&&isMuseiShiinEnhanced(s,ii-1)&&isMuseiShiinEnhanced(s,ii+1))||
				(ii>0&&isMuseiShiinEnhanced(s,ii-1)&&ii==s.size()-1))){
					museiBoin[ii]=1;
			}
		}

		//テヲツッツ催ゥツ淞ウテ」ツ?径テ」ツ?催」ツ?経テ」ツ?催」ツ?ォテ」ツ?、テ」ツ??」ツ?ヲテッツシツ古・ツ青古、ツクツ?」ツ?ョテヲツッツ催ゥツ淞ウテ」ツ?古ァツ?。テ・ツ」ツーテ・ツュツ静ゥツ淞ウテ」ツ?ィテ」ツ?ィテ」ツつづ」ツ?ォテゥツ?」テァツカツ堙」ツ?凖」ツつ?テ」ツ?、テ、ツサツ・テ、ツクツ甘」ツ?ョテヲツ仰催」ツ?ァテァツ渉セテ」ツつ古」ツ?淌」ツ?ィテ」ツ?催ッツシツ?
		//テ」ツ?淌」ツ??」ツ?療ッツシツ古」ツ?敕」ツ?ョテゥツ?」テァツカツ堙」ツ?凖」ツつ凝ヲツ仰催」ツ?ョテ」ツ??」ツ?。テ」ツ?ァテヲツ慊?・ツセツ古」ツ?ョテ」ツつづ」ツ?ョテ」ツ?ォテ」ツ?、テ」ツ??」ツ?ヲテ」ツ?ッテゥツ卍、テ・ツ、ツ姪」ツ?陛」ツつ古」ツつ凝ッツシツ偲、ツサツ・テ、ツクツ凝」ツ?ォテ」ツ??」ツ?湘」ツ?、テ」ツ?凝」ツ?ョテ、ツセツ凝」ツつ津ァツ、ツコテ」ツ?凖ッツシツ?
		//テ、ツソツεゥツ淞ウテ」ツ?甘」ツつ暗」ツ?ウテゥツ閉キテゥツ淞ウテ」ツ?ッテ」ツ?イテ」ツ?ィテ」ツ?、テ」ツ?ョテヲツ仰催」ツつ津ヲツァツ凝ヲツ按静」ツ?凖」ツつ凝」ツ?禿」ツ?ィテ」ツ?凝」ツつ嘉ッツシツ古ゥツ?」テァツカツ堙ゥツδィテ・ツ按?」ツ?ョテ・ツ?暗ゥツ?ュテ」ツ?セテ」ツ?淌」ツ?ッテゥツ?氾、ツクツュテ」ツ?ォテッツシツ古、ツソツεゥツ淞ウテ」ツ?セテ」ツ?淌」ツ?ッテゥツ閉キテゥツ淞ウテ」ツ?古」ツ?づ」ツ?」テ」ツ?ヲテ」ツ?ッテ」ツ?ェテ」ツつ嘉」ツ?ェテ」ツ??」ツ?ィテ」ツ??」ツ??ァツつケテ」ツ?ォテ」ツ?ッテヲツウツィテヲツ?湘」ツ?凖」ツつ凝」ツ?禿」ツ?ィテッツシツ?
		REP(i,boin.size()){
			int ii=boin[i];
			if((isAO(s[ii])&&0<ii&&ii+2<s.size()&&s[ii+2]==s[ii]&&isMuseiShiinEnhanced(s,ii-1)&&isMuseiShiin(s[ii+1]))||
			   (isAO(s[ii])&&0<ii&&ii+3<s.size()&&s[ii+3]==s[ii]&&isMuseiShiinEnhanced(s,ii-1)&&isMuseiShiin(s[ii+1])&&s[ii+2]=='y')){
				museiBoin[ii]=1;
			}
		}
		
		//テヲツッツ催ゥツ淞ウテ」ツ?古ァツ?。テ・ツ」ツーテ・ツ個姪」ツ?陛」ツつ古」ツつ凝」ツ?ョテ」ツ?ッテッツシツ古ヲツ慊?・ツ按敕」ツ?ョテヲツッツ催ゥツ淞ウテ」ツ?ァテ」ツ?づ」ツつ凝・ツ?エテ・ツ青暗ッツシツ古」ツ?セテ」ツ?淌」ツ?ッテァツ崢エティツソツ妥」ツ?ョテヲツッツ催ゥツ淞ウテ」ツ?古ァツ?。テ・ツ」ツーテ・ツ個姪」ツ?陛」ツつ古」ツ?ェテ」ツ?凝」ツ?」テ」ツ?淌・ツ?エテ・ツ青暗」ツ?ァテ」ツ?づ」ツつ甘ッツシツ古」ツ?セテ」ツ?淌」ツ?敕」ツつ古」ツつ嘉」ツ?ョテ・ツ?エテ・ツ青暗」ツ?ォテ」ツ?凝」ツ?偲」ツつ凝ッツシツ?
		FOR(i,1,boin.size()){
			int cur=boin[i],prev=boin[i-1];
			if(museiBoin[prev]){
				museiBoin[cur]=0;
			}
		}

		REP(i,s.size()){
			if(museiBoin[i]){
				cout<<"("<<s[i]<<")";
			}else{
				cout<<s[i];
			}
		}
		cout<<endl;
	}
}

Measured memory_bytes: 1208