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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

enum Type{
  Bo = 0,
  SiBo,
  Soku,
  Hatu,
  Tho
};

bool isvo(char c){
  return string("aiueo").find(c) != string::npos;
}
bool issi(char c){
  return string("kstnhmyrwgzdbp").find(c) != string::npos;
}
bool ismusi(char c){
  return string("ksthp").find(c) != string::npos;
}
string tos(char c){
  return string(1, c);
}

using Mora = pair<string,Type>;
vector<Mora> decomp(string s){
  vector<Mora> res;

  int N = SZ(s);
  for(int i=0;i<N;){
	if(isvo(s[i])){
	  if(i-1 >= 0 && isvo(s[i-1]) && s[i] != 'e' && s[i] != 'o'){
		res.EB(tos(s[i]), Tho);
		++i;
	  }
	  else{
		res.EB(tos(s[i]), Bo);
		++i;
	  }
	}
	else if(issi(s[i])){
	  if(i+1 < N && isvo(s[i+1])){
		res.EB(s.substr(i,2), SiBo);
		i += 2;
	  }
	  else if(i+2 < N && s[i] != 'y' && s[i] != 'w' && s[i+1] == 'y' && isvo(s[i+2])){
		res.EB(s.substr(i,3), SiBo);
		i += 3;
	  }
	  else if(i+1 < N && s[i] == s[i+1]){
		res.EB(tos(s[i]), Soku);
		++i;
	  }
	  else if(i+1<N && s[i+1] == '\''){
		res.EB(s.substr(i,2), Hatu);
		i += 2;
	  }
	  else{
		res.EB(tos(s[i]), Hatu);
		++i;
	  }
	}
	else{
	  exit(1);
	}
  }

  return res;
}

bool ismuka(vector<Mora>& moras, int i){
  if(moras[i].SS != Bo && moras[i].SS != SiBo)
	return false;
  
  char c = moras[i].FF.back();
  if(c == 'i' || c == 'u'){
	if(moras[i].SS == Bo){
	  return (i>0 && ismusi(moras[i-1].FF.back())
			  && (i+1 >= SZ(moras) || ismusi(moras[i+1].FF[0])));
	}
	else{
	  return (ismusi(moras[i].FF[0])
			  && (i+1 >= SZ(moras) || ismusi(moras[i+1].FF[0])));
	}
  }
  else if(c == 'a' || c == 'o'){
	return (moras[i].SS == SiBo && ismusi(moras[i].FF[0])
			&& i+1 < SZ(moras)
			&& moras[i+1].SS == SiBo
			&& ismusi(moras[i+1].FF[0])
			&& moras[i+1].FF.back() == c
			);
  }

  return false;
}

void pr(const string& s, bool fl){
  if(!fl){
	cout << s;
  }
  else{
	cout << s.substr(0, SZ(s)-1) << "(" << s.back() << ")";
  }
}

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  string S;
  while(cin>>S,S!="#"){
	vector<Mora> moras = decomp(S);
	//for(auto&&p:moras)cout<<p<<endl;	cout<<endl;
	int M = SZ(moras);
	vector<bool> muka(M);
	REP(i,M)
	  muka[i] = ismuka(moras, i);

	bool cont = false;
	REP(i,M){
	  if(cont){
		muka[i] = false;
		if(moras[i].SS == Bo || moras[i].SS == SiBo){
		  cont = false;
		}
	  }
	  else if(muka[i]){
		cont = true;
	  }
	}

	REP(i,M) pr(moras[i].FF, muka[i]);
	cout << endl;
  }

  return 0;
}

Measured memory_bytes: 3212