#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;
const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;
template <typename T1, typename T2>
bool chmax(T1 &a, const T2 &b) {
  if(a < b) {a = b; return true;}
  return false;
}
template <typename T1, typename T2>
bool chmin(T1 &a, const T2 &b) {
  if(a > b) {a = b; return true;}
  return false;
}
template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}
template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for(int i=0;i<((int)(v.size()));++i) {
    if(i) os << " ";
    os << v[i];
  }
  return os;
}
bool solve() {
  string s; cin >> s;
  if(s == "#") return false;
  int n = (int)(s.size());
  vector<pair<int, string>> tokens;
  map<char, int> mp;
  string tmp1 = "aiueo", tmp2 = "ksthp";
  for(int i=0;i<(26);++i) mp['a'+i] = 2;
  for(int i=0;i<((int)(tmp1.size()));++i) mp[tmp1[i]] = 0;
  for(int i=0;i<((int)(tmp2.size()));++i) mp[tmp2[i]] = 1;
  mp['\''] = 3;
  for(int i=0;i<(n);++i) {
    switch(mp[s[i]]) {
      case 0:
        if(i != 0 && mp[s[i-1]] == 0) {
          tokens.emplace_back(5, s.substr(i, 1));
        } else {
          tokens.emplace_back(0, s.substr(i, 1));
        }
        break;
      case 1:
        if(i != n-1 && s[i] == s[i+1]) {
          tokens.emplace_back(4, s.substr(i, 1));
        } else if(i != n-1 && s[i+1] == 'y') {
          tokens.emplace_back(1, s.substr(i, 2));
          i++;
        } else {
          tokens.emplace_back(1, s.substr(i, 1));
        }
        break;
      case 2:
        if(s[i] == 'n' && i != n-1 && s[i+1] == '\'') {
          tokens.emplace_back(3, s.substr(i, 2));
          i++;
        } else if(s[i] == 'n' && (i == n-1 || mp[s[i+1]] != 0)) {
          tokens.emplace_back(3, s.substr(i, 1));
        } else {
          tokens.emplace_back(2, s.substr(i, 1));
        }
        break;
      default:
        assert(false);
        break;
    }
  }
  int sz = (int)(tokens.size());
  vector<bool> v1(sz), v2(sz), v3(sz);
  for(int i=0;i<(sz);++i) {
    if(tokens[i].first == 0 && (tokens[i].second == "i" || tokens[i].second == "u")) {
      if(i != 0 && i != sz-1 && tokens[i-1].first == 1 && (tokens[i+1].first == 1 || tokens[i+1].first == 4)) v1[i] = true;
      else if(i != 0 && i == sz-1 && tokens[i-1].first == 1 && (i == 1 || tokens[i-2].first != 4)) v1[i] = true;
    } else if(tokens[i].first == 0 && tokens[i].second == "a") {
      if(i != 0 && tokens[i-1].first == 1) v2[i] = true;
    } else if(tokens[i].first == 0 && tokens[i].second == "o") {
      if(i != 0 && tokens[i-1].first == 1) v3[i] = true;
    }
  }
  vector<bool> v4(sz), v5(sz);
  for(int i=0;i<(sz);++i) {
    if(v2[i] && i < sz-2 && v2[i+2]) v4[i] = true;
    if(v3[i] && i < sz-2 && v3[i+2]) v5[i] = true;
  }
  for(int i=0;i<(sz);++i) {
    v1[i] = v1[i] | v4[i] | v5[i];
  }
  for(int i=0;i<(sz);++i) {
    int prevpos = i-1;
    while(prevpos >= 0 && tokens[prevpos].first != 0) prevpos--;
    if(prevpos >= 0) {
      if (v1[i] && v1[prevpos]) v1[i] = false;
    }
  }
  for(int i=0;i<(sz);++i) {
    if(v1[i]) {
      cout << '(' << tokens[i].second << ')';
    } else {
      cout << tokens[i].second;
    }
  }
  cout << endl;
  return true;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  while(solve()) {}
}



Measured memory_bytes: 3156