#include <string>
#include <vector>
#include <iostream>

using namespace std;

const string sv = "aiueo";
const string sm = "ksthp";

bool voin(char c)
{
	return sv.find(c) != string::npos;
}

bool cho(char c1, char c2)
{
	switch (c1)
	{
		case 'a': return c2 == 'a';
		case 'i': return c2 == 'i';
		case 'u': return c2 == 'u';
		case 'e': return c2 == 'i';
		case 'o': return c2 == 'u';
	}

	return false;
}

bool mus(char c)
{
	return sm.find(c) != string::npos;
}

vector<string> separate(string S)
{
	int ptr = 0;
	
	vector<string> T;

	while (ptr < S.size())
	{
		if (S[ptr] == 'n')
		{
			if (ptr + 1 == S.size())
			{
				T.push_back("n"); ptr++;
			}
			else if (S[ptr + 1] == 39) // 39 == '
			{
				T.push_back("n'"); ptr += 2;
			}
			else if (S[ptr + 1] == 'y')
			{
				if (ptr + 3 == S.size())
				{
					T.push_back(S.substr(ptr, 3)); ptr += 3;
				}
				else if (!voin(S[ptr + 3]))
				{
					T.push_back(S.substr(ptr, 3)); ptr += 3;
				}
				else
				{
					T.push_back(S.substr(ptr, 3));
					T.push_back("x"); ptr += 4;
				}
			}
			else if (!voin(S[ptr + 1]))
			{
				T.push_back("n"); ptr++;
			}
			else
			{
				if (ptr + 2 == S.size())
				{
					T.push_back(S.substr(ptr, 2)); ptr += 2;
				}
				else if (!cho(S[ptr + 1], S[ptr + 2]))
				{
					T.push_back(S.substr(ptr, 2)); ptr += 2;
				}
				else
				{
					T.push_back(S.substr(ptr, 2));
					T.push_back("x"); ptr += 3;
				}
			}
		}
		else if (voin(S[ptr]))
		{
			if (ptr + 1 == S.size())
			{
				T.push_back(S.substr(ptr, 1)); ptr++;
			}
			else if (!cho(S[ptr], S[ptr + 1]))
			{
				T.push_back(S.substr(ptr, 1)); ptr++;
			}
			else
			{
				T.push_back(S.substr(ptr, 1));
				T.push_back("x"); ptr += 2;
			}
		}
		else
		{
			if (voin(S[ptr + 1]))
			{
				if (ptr + 2 == S.size())
				{
					T.push_back(S.substr(ptr, 2)); ptr += 2;
				}
				else if (!cho(S[ptr + 1], S[ptr + 2]))
				{
					T.push_back(S.substr(ptr, 2)); ptr += 2;
				}
				else
				{
					T.push_back(S.substr(ptr, 2));
					T.push_back("x"); ptr += 3;
				}
			}
			else if (S[ptr + 1] == 'y')
			{
				if (ptr + 3 == S.size())
				{
					T.push_back(S.substr(ptr, 3)); ptr += 3;
				}
				else if (!cho(S[ptr + 2], S[ptr + 3]))
				{
					T.push_back(S.substr(ptr, 3)); ptr += 3;
				}
				else
				{
					T.push_back(S.substr(ptr, 3));
					T.push_back("x"); ptr += 4;
				}
			}
			else
			{
				T.push_back(S.substr(ptr, 1)); ptr++;
			}
		}
	}

	return T;
}

string solve(string S)
{
	vector<string> T = separate(S);

	vector<bool> R(T.size());

	for (int i = 0; i < T.size(); i++)
	{
		if (T[i].back() == 'i' || T[i].back() == 'u')
		{
			if (i + 1 != T.size())
			{
				if (mus(T[i][0]) && mus(T[i + 1][0]))
				{
					R[i] = true;
				}
			}
			else
			{
				if (mus(T[i][0]))
				{
					R[i] = true;
				}
			}
		}

		if (i + 1 != T.size() && (T[i].back() == 'a' || T[i].back() == 'o'))
		{
			if (mus(T[i][0]) && mus(T[i + 1][0]) && T[i].back() == T[i + 1].back())
			{
				R[i] = true;
			}
		}
	}

	int count_ = 0;

	for (int i = 0; i < T.size(); i++)
	{
		if (T[i] == "x")
		{
			T[i] = S[count_];
		}

		count_ += T[i].size();
	}

	for (int i = 0; i < T.size(); i++)
	{
		if (R[i] == true)
		{
			int ptr = i;

			while (true)
			{
				if (--ptr < 0) { break; }

				if (voin(T[ptr].back())) { break; }
			}
			
			if (ptr >= 0)
			{
				if (R[ptr] == true)
				{
					R[i] = false;
				}
			}
		}
	}

	string ret;

	for (int i = 0; i < T.size(); i++)
	{
		if (R[i])
		{
			ret += T[i].substr(0, T[i].size() - 1) + "(" + T[i].back() + ")";
		}
		else
		{
			ret += T[i];
		}
	}

	return ret;
}

int main()
{
	string S;

	while (true)
	{
		cin >> S;

		if (S == "#") { break; }

		cout << solve(S) << endl;
	}

	return 0;
}

Measured memory_bytes: 3088