import java.util.*;

/**class - hyp hypernates a String */
public class hyp {
    
    /**method hyp - hypernates a String
     * @param w the String to be hypernated */ 
    public String hyp(String w) {
	String temp = "", answer = "";		
	StringTokenizer t = new StringTokenizer(w,"aeiouyæøåAEIOUYÆØÅ",true);
	
	if (!t.hasMoreTokens())
	    //Fejl i stringen
	    System.out.println("It's an underdeveloped String ");
	else
	    { answer = t.nextToken();
	    
	    if ( t.hasMoreTokens() &&
		 ( isVokal( ( temp = t.nextToken() ).toLowerCase().charAt(0) ) ) )
		answer = answer + temp;
	    else
		answer += '-'+temp;
	    
	    while (t.hasMoreTokens() ) {   
		
		temp = t.nextToken();
		if ( !isVokal(temp.charAt(0)) )
		    if ( !t.hasMoreTokens() )
			answer += temp; 
		
		    else {
			answer += temp.substring(0,temp.length()/2) + "-"
			       +  temp.substring(  temp.length()/2,
						   temp.length() );
			answer += t.nextToken();
		    }
		
		else {
		    if ( isVokal( answer.toLowerCase().charAt(answer.length()-1 ) ) )
			answer += "-" + temp;
		    else
			answer += temp;			
	    	}
	    }
	    }
	return(answer);
    }
    
    /**method isVokal - checks if a char c is a vokal
     *@param c the character to check */ 
    public boolean isVokal(char c) {
	return ( (c=='a') || (c=='e') || (c=='i') || (c=='o') ||
		 (c=='u') || (c=='y') || (c=='æ') || (c=='ø') ||
		 (c=='å') );
    }
}
