#include<iostream>
#include<string>
#include<vector>
#define INV 'q'
#define NOTYPE 0
#define SOKUON 1
#define HATUON 2
#define TYOOON 3
#define TANNON 4

#define N_DBG

using namespace std;

struct phrase{
	phrase():si(INV),bo(INV),y(false),apos(false),nv(false),type(NOTYPE){}
	char si;
	char bo;
	bool y;
	bool apos;
	bool nv;
	int type;
	void reset(){
		si=INV;bo=INV;y=false;type=NOTYPE;apos=false;
	}
};

#ifdef N_DBG
ostream &operator<<(ostream &os, const phrase &p){
	if( p.type == HATUON ){
		os << 'n';
		if( p.apos )
			os << (char)0x27;
	}
	if( p.type == TYOOON ){
		os << p.bo;
	}
	if( p.type == SOKUON ){
		os << p.si;
	}
	if( p.type == TANNON ){
		os << p.bo;
	}
	if( p.type == NOTYPE ){
		os << p.si;
		if( p.y )
			os << 'y';
		if( p.nv )
			os << '(';
		os << p.bo;
		if( p.nv )
			os << ')';
	}
	return os;
}
#else
ostream &operator<<(ostream &os, const phrase &p){
	if( p.type == HATUON ){
		os << "-¹-";
	}
	if( p.type == TYOOON ){
		os << "-·¹-";
	}
	if( p.type == SOKUON ){
		os << "-£¹-";
	}
	if( p.type == TANNON ){
		os << p.bo;
	}
	if( p.type == NOTYPE ){
		os << p.si;
		if( p.y )
			os << 'y';
		if( p.nv )
			os << '(';
		os << p.bo;
		if( p.nv )
			os << ')';
	}
	return os;
}
#endif

string boin("aiueo");
string siin("kstnhmyrwgzdbp");
string nvsiin("ksthp");

int main(){
	while(true){
		string s;
		cin>>s;
		if( s == "#" ) break;
		vector< phrase > term;
		phrase p;

		/* ðÍ */
		for(unsigned int i = 0; i < s.length(); ++i){
			if( boin.find_first_of( s[i] ) != boin.npos ){
				// cout << " BO:"<<i;
				/* ê¹ */
				p.bo = s[i];
				if( i > 0 ){
					if( boin.find_first_of(s[i-1]) != boin.npos || s[i-1] == 0x27 ){
						p.type = TANNON;
					}
				}
				if( i > 0 ){
					if( boin.find_first_of(s[i-1]) != boin.npos && (s[i] == 'a' || s[i] == 'i' || s[i] == 'u') ){
						/* ê¹+aiuÈç·¹ */
						p.type = TYOOON;
					}
				}else{
					p.type = TANNON;
				}
				term.push_back( p );
				p.reset();
				continue;
			}
			if( i < s.length() - 1 ){
				if( s[i] == 'n' && s[i+1] == 0x27 ){
					// cout << " NAPO:"<<i;
					/* n Å¼ãªA|X */
					p.type = HATUON;
					p.apos = true;
					i+=1;
					term.push_back( p );
					p.reset();
					continue;
				}
				if( siin.find_first_of( s[i] ) != siin.npos && siin.find_first_of( s[i+1] ) != siin.npos ){
					//cout << " SI2:"<<i;
					/* ê¹Åà·¹ÅàÈ­AÓ½ÂÌq¹ªA±µÄ¢é */
					if( s[i] != 'y' && s[i] != 'w' && s[i+1] == 'y' ){
						/* ÉáÉãÉåÈÇ */
						p.si = s[i];
						p.bo = s[i+2];
						p.y = true;
						p.type = NOTYPE;
						i+=2;
					}else if( s[i] == 'n' && ( siin.find_first_not_of( s[i+1] ) != siin.npos && s[i+1] != 'y' ) ){
						/* n Ì¼ãªyÈOÌq¹Å éÆ«A»êÍ¹ */
						p.type = HATUON;
					}else{
						/* ãLÌ¢¸êÅàÈ¢A©Âq¹ªÓ½ÂA±µÄ¢éÈç£¹ */
						p.si = s[i];
						p.type = SOKUON;
					}
					term.push_back( p );
					p.reset();
					continue;
				}
			}
			if( siin.find_first_of( s[i] ) != siin.npos ){
				// cout << " SI:"<<i;
				/* ê¹ÅàÈ­Ó½ÂÌq¹ªA±µÄ¢È¢ÈçA»êÍÌnßÌq¹ */
				p.si = s[i];
				if( s[i] == 'n' && i == s.length() - 1 ){
					p.type = HATUON;
					term.push_back( p );
					p.reset();
				}
			}
		}
		
		for(unsigned int i = 0; i < term.size(); ++i){
			if( term[i].bo == 'i' || term[i].bo == 'u' && term[i].type != TYOOON ){
				if( i < term.size() - 1 ){
					/* êåÌöÅÈ¢ */
					// cout << "TEST: " << term[i].si << ' ' << term[i+1].si << endl;
					if( nvsiin.find_first_of( term[i].si ) != nvsiin.npos && nvsiin.find_first_of( term[i+1].si ) != nvsiin.npos ){
						/* ©ÂÌq¹Æ±ÌÌq¹ª³ºq¹Å èAÜ½ÍÌª£¹ */
						term[i].nv = true;
					}
				}else if( nvsiin.find_first_of( term[i].si ) != nvsiin.npos ){
					/* êåÌöÅ èAÌq¹ª³ºq¹ */
					term[i].nv = true;
				}
			}else if( term[i].bo == 'a' || term[i].bo == 'o' ){
				if( nvsiin.find_first_of( term[i].si ) != nvsiin.npos && i < term.size() - 1 ){
					if( nvsiin.find_first_of( term[i+1].si ) != nvsiin.npos && term[i+1].bo == term[i].bo && term[i+1].type == NOTYPE ){
						term[i].nv = true;
					}
				}
			}
		}
		for(unsigned int i = 0; i < term.size(); ++i){
			for(int j = i - 1; j >= 0; --j){
				if( term[i].type == NOTYPE && term[j].type == NOTYPE ){
					if( term[i].nv && term[j].nv ){
						term[i].nv = false;
					}
					break;
				}
			}
		}

		for(unsigned int i = 0; i < term.size(); ++i){ cout << term[i]; }
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 0