#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)n; ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cout<<*i<<" "; cout<<endl; }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
string vowel = "aiueo";
bool isvowel(char c){
  REP(i, 5)if(c == vowel[i]) return true;
  return false;
}
bool ksthp(char c){
  return (c == 'k' || c == 's' || c == 't' || c == 'h' || c == 'p');
}
bool iu(char c){
  return (c == 'i' || c == 'u');
}
bool ao(char c){
  return (c == 'a' || c == 'o');
}

int main(){
  string s;
  while(cin>>s && s != "#"){
    vector<string> mora;
    int N = s.size();
    string tmp;
    REP(i, N){
      if(tmp == "n" && !isvowel(s[i])){
        mora.push_back("n");
        tmp = s[i];
      }else if(s[i] == '\''){
        tmp += "'";
        mora.push_back(tmp);
        tmp = "";
      }else if(isvowel(s[i])){
        tmp += s[i];
        mora.push_back(tmp);
        tmp = "";
      }else{
        tmp += s[i];
      }
    }
    if(tmp != "")mora.push_back(tmp);
    int M = mora.size();
    vector<bool> rule1(M);
    vector<bool> rule2(M);
    REP(i, M - 1){
      if(ksthp(mora[i][0]) && ksthp(mora[i+1][0])){
        if(iu(mora[i][mora[i].size()-1])) rule1[i] = true;
        if(mora[i+1][0] != mora[i+1][1] && mora[i][mora[i].size()-1] == mora[i+1][mora[i+1].size()-1] && ao(mora[i][mora[i].size()-1])) rule2[i] = true;
      }
    }
    if(ksthp(mora[M-1][0]) && iu(mora[M-1][mora[M-1].size()-1])) rule1[M-1] = true;
    bool bf = false;
    REP(i, M){
      //cout<<mora[i]<<" ";
      if((rule1[i] || rule2[i]) && !bf) {
        cout<<mora[i].substr(0, mora[i].size()-1) + "(" + mora[i][mora[i].size()-1] + ")";
        bf = true;
      }else{
        bf = false;
        cout<<mora[i];
      }
    }
    cout<<endl;
    //REP(i, M - 1)if(kathp[mora[i][0])
  }
  return 0;
}