#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAXLEN = 100;

/* typedef */

enum { CNA, CBO, CYS, CMS, CAP };
enum { MB, MSB, MSYB, MSOKU, MHATSU, MCHO };

struct Mora {
  int type;
  bool musei, ap;
  char cs, cb;

  Mora() { musei = false; }

  void print() {
    if (musei) {
      if (type == MSYB)
	printf("%cy(%c)", cs, cb);
      else
	printf("%c(%c)", cs, cb);
    }
    else if (type == MSYB)
      printf("%cy%c", cs, cb);
    else if (type == MSB)
      printf("%c%c", cs, cb);
    else if (type == MB || type == MCHO)
      printf("%c", cb);
    else if (ap)
      printf("%c'", cs);
    else
      printf("%c", cs);
  }
};

/* global variables */

Mora mrs[MAXLEN];

const int chs[] = {
//  a,   b,   c,   d,   e,   f,   g,   h,   i,   j,   k,   l,   m,   n,
  CBO, CYS, CNA, CYS, CBO, CNA, CYS, CMS, CBO, CNA, CMS, CNA, CYS, CYS,
//  o,   p,   q,   r,   s,   t,   u,   v,   w,   x,   y,   z
  CBO, CMS, CNA, CYS, CMS, CMS, CBO, CNA, CYS, CNA, CYS, CYS
};

/* subroutines */

inline int ccat(char ch) {
  return (ch == 0) ? CNA : (ch == '\'') ? CAP : chs[ch - 'a'];
}

inline bool boin(char ch) { return ccat(ch) == CBO; }
inline bool shiin(char ch) { return ccat(ch) == CYS || ccat(ch) == CMS; }
inline bool mshiin(char ch) { return ccat(ch) == CMS; }

/* main */

int main() {
  for (;;) {
    string str;
    cin >> str;
    if (str == "#") break;

    int len = str.size(), nm = 0;
    char prvb = 0;
    
    for (int pos = 0; pos < len; prvb = mrs[nm].cb, nm++) {
      char cch = str[pos];
      int cur = ccat(cch);

      Mora& mr = mrs[nm];
      mr.musei = mr.ap = false;
      
      if (cur == CBO) {
	if ((cch == 'a' && prvb == 'a') ||
	    (cch == 'i' && (prvb == 'e' || prvb == 'i')) ||
	    (cch == 'u' && (prvb == 'o' || prvb == 'u'))) {	// 5. chouon
	  mr.type = MCHO;
	  mr.cs = 0;
	  mr.cb = cch;
	  pos++;
	}
	else {	// 1. boin
	  mr.type = MB;
	  mr.cs = 0;
	  mr.cb = cch;
	  pos++;
	}
      }
      else if (cur == CYS || cur == CMS) {
	char nch = str[pos + 1];
	int nxt = ccat(nch);

	if (nxt == CBO) {	// 2. shiin + boin
	  mr.type = MSB;
	  mr.cs = cch;
	  mr.cb = nch;
	  pos += 2;
	}
	
	else if (cch != 'y' && cch != 'w' && nch == 'y' &&
		 ccat(str[pos + 2]) == CBO) {	// 3. shiin + 'y' + boin
	  mr.type = MSYB;
	  mr.cs = cch;
	  mr.cb = str[pos + 2];
	  pos += 3;
	}

	else if (cch == nch) {	// 4. sokuon
	  mr.type = MSOKU;
	  mr.cs = cch;
	  mr.cb = 0;
	  pos++;
	}

	else if (cch == 'n') {	// 5. hatsuon
	  mr.type = MHATSU;
	  mr.cs = cch;
	  mr.cb = 0;
	  if (nxt == CAP) mr.ap = true, pos += 2;
	  else pos++;
	}

	else {
	  printf("Error!: pos=%d, cch=%c\n", pos, cch);
	  return 0;
	}
      }
    }

    if (false) {
      for (int i = 0; i < nm; i++) mrs[i].print(), cout << ' ';
      cout << endl;
    }

    bool pmu = false;
    for (int i = 0; i < nm; i++) {
      Mora& mr = mrs[i];
      Mora& nmr = mrs[i + 1];

      if (! pmu) {
	pmu = false;
	switch (mr.cb) {
	case 'i':
	case 'u':
	  if (ccat(mr.cs) == CMS && (i == nm - 1 || ccat(nmr.cs) == CMS))
	    mr.musei = pmu = true;
	  break;
	case 'a':
	case 'o':
	  if (ccat(mr.cs) == CMS &&
	      i < nm - 1 && mr.cb == nmr.cb && ccat(nmr.cs) == CMS)
	    mr.musei = pmu = true;
	  break;
	}
      }
      else if (mr.cb != 0)
	pmu = false;
    }

    if (false) {
      for (int i = 0; i < nm; i++) printf("%d ", (int)mrs[i].musei);
      cout << endl;
    }

    for (int i = 0; i < nm; i++) mrs[i].print();
    cout << endl;
  }
  
  return 0;
}

Measured memory_bytes: 1212