#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/

string s;
set<char> boin = { 'a', 'i', 'u', 'e', 'o' };
set<char> shiin = { 'k','s','t','n', 'h','m','y','r','w','g','z','d','b','p' };
set<char> musei_shiin = { 'k', 's', 't', 'h', 'p' };

enum sound
{
	BOIN, SHIIN, SOKUON, HATUON, TYOON, OTHER
};

vector<sound> v;

pair<sound, int> pre(int pos)
{
	if (pos == 0) return make_pair(OTHER, -1);
	pos--;
	if (v[pos] == OTHER) pos--;
	return make_pair(v[pos], pos);
}

pair<sound, int> nex(int pos)
{
	if (pos == s.size() - 1) return make_pair(OTHER, -1);
	pos++;
	if (v[pos] == OTHER) pos++;
	return make_pair(v[pos], pos);
}

int main()
{
	cin.sync_with_stdio(false); cout << fixed << setprecision(10);
	while (cin >> s, s != "#")
	{
		v.clear();
		int n = s.size();
		v.resize(n);
		REP(i, n)
		{
			if (boin.count(s[i]))
			{
				if (i > 0 && s[i - 1] == s[i] && (s[i] == 'a' || s[i] == 'i' || s[i] == 'u'))
				{
					v[i] = TYOON;
				}
				else v[i] = BOIN;
			}
			else if (s[i] == 'n')
			{
				if (i == n - 1)
				{
					v[i] = HATUON;
				}
				else if (s[i + 1] == '\'')
				{
					v[i] = HATUON;
					v[i + 1] = OTHER;
					i++;
				}
				else if (s[i + 1] == 'y')
				{
					v[i] = SHIIN;
					v[i + 1] = OTHER;
				}
				else if (shiin.count(s[i + 1]))
				{
					v[i] = HATUON;
				}
				else if (boin.count(s[i + 1]))
				{
					v[i] = SHIIN;
				}
				else assert(false);
			}
			else if (shiin.count(s[i]))
			{
				assert(i < n - 1);
				if (s[i + 1] == 'y')
				{
					v[i] = SHIIN;
					v[i + 1] = OTHER;
					i++;
				}
				else if (s[i + 1] == s[i])
				{
					v[i] = SOKUON;
				}
				else if(boin.count(s[i+1]))
				{
					v[i] = SHIIN;
				}
				else assert(false);
			}
			else assert(false);
		}

		int cntboin = 0;
		vi boins;
		REP(i, n)
		{
			if (v[i] == BOIN)
			{
				cntboin++;
				boins.push_back(i);
			}
		}
		
		vector<bool> museika(cntboin);
		REP(i, cntboin)
		{
			int pos = boins[i];
			assert(v[pos] == BOIN);

			if (s[pos] == 'i' || s[pos] == 'u')
			{
				auto t_pre = pre(pos), t_nex = nex(pos);
				if ((t_pre.first == SHIIN || t_pre.first == SOKUON) && musei_shiin.count(s[t_pre.second]) &&
					(t_nex.first == SHIIN || t_nex.first == SOKUON) && musei_shiin.count(s[t_nex.second]))
				{
					museika[i] = true;
				}
				else if (pos == n - 1 && t_pre.first == SHIIN && musei_shiin.count(s[t_pre.second]))
				{
					museika[i] = true;
				}
			}
			if (s[pos] == 'a' || s[pos] == 'o')
			{
				auto t_pre = pre(pos);
				if (t_pre.first != SHIIN || !musei_shiin.count(s[t_pre.second])) continue;
				bool f = true;
				int tmp = pos + 1;
				while (tmp < n)
				{
					if (v[tmp] == BOIN) break;
					if (v[tmp] == SOKUON || v[tmp] == TYOON || v[tmp] == HATUON)
					{
						f = false;
						break;
					}
					tmp++;
				}
				if (!f) continue;
				auto n_pre = pre(tmp);
				if (s[tmp] != s[pos]) continue;
				if (n_pre.first != SHIIN || !musei_shiin.count(s[n_pre.second])) continue;
				museika[i] = true;
			}
	
		}
		
		FOR(i, 1, museika.size())
		{
			if (museika[i] && museika[i - 1])
			{
				museika[i] = false;
			}
		}

		int cnt = 0;
		REP(i, n)
		{
			if (v[i] == BOIN)
			{
				if (museika[cnt])
				{
					cout << '(' << s[i] << ')';
				}
				else
				{
					cout << s[i];
				}
				cnt++;
			}
			else cout << s[i];
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 3228