Easier Done than Said?
Difficulty: Hard

Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-generated passwords (like xvtpzyo), but users have a hard time remembering them and sometimes leave them written on notes stuck to their computer. One potential solution is to generate "pronounceable" passwords that are relatively secure but still easy to remember.

FnordCom is developing such a password generator. You work in the quality control department, and it's your job to test the generator and make sure that the passwords are acceptable. To be acceptable, a password must satisfy these three rules:

1. It must contain at least one vowel.
2. It cannot contain three consecutive vowels or three consecutive consonants
3. It cannot contain two consecutive occurrences of the same letter, except for 'ee' or 'oo'.

(For the purposes of this problem, the vowels are 'a', 'e', 'i', 'o', and 'u'; all other
letters are consonants.) Note that these rules are not perfect; there are many
common/pronounceable words that are not acceptable.

**Input Format:**
The input consists of one or more potential passwords, one per line, followed by a line
containing only the word 'end' that signals the end of input. Each password is at
least one and at most twenty letters long and consists only of lowercase letters. 

**Output Format:**
For each password, output whether or not it is acceptable, using the precise format shown in the example.

**Example input:**  

	a  
	tv  
	ptoui  
	bontres  
	zoggax  
	wiinq  
	eep  
	houctuh  
	end  

**Expected Output:**  

	<a> is acceptable.  
	<tv> is not acceptable.  
	<ptoui> is not acceptable.  
	<bontres> is not acceptable.  
	<zoggax> is not acceptable.  
	<wiinq> is not acceptable.  
	<eep> is acceptable.  
	<houctuh> is acceptable.  


Input Format:

Output Format:

Sample Input:

Sample Output:

Python 3 starter code:


Reference solution (C++):
	#include <stdio.h>
	#include <stdlib.h>
	#include <string.h>

	FILE *in;
	FILE *out;

	char word[256];
	int n;



	int is_vowel(int ch)
	{
    return ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch=='u';
	}



	int contains_vowel(void)
	{
    int i;
    
    for (i = 0; i < n; ++i) {
        if (is_vowel(word[i]))
            return 1;
    }
    
    return 0;
	}
    
    

	int three_consecutive_vowels(void) 
	{
    int i;
    
    for (i = 0; i < (n - 2); ++i) {
        if (is_vowel(word[i]) && is_vowel(word[i+1]) && is_vowel(word[i+2]))
            return 1;
    }
    
    return 0;
	}



	int three_consecutive_consonants(void) 
	{
    int i;
    
    for (i = 0; i < (n - 2); ++i) {
        if (!is_vowel(word[i]) && !is_vowel(word[i+1]) && !is_vowel(word[i+2]))
            return 1;
    }
    
    return 0;	
	}



	int repeated_letter(void) 
	{
    int i;
    
    for (i = 0; i < (n - 1); ++i) {
        if (word[i] == word[i+1] && word[i] != 'e' && word[i] != 'o')
            return 1;
    }
    
    return 0;
	}




	int can_say_it(void)
	{
    return contains_vowel()
        && ! three_consecutive_vowels()
        && ! three_consecutive_consonants()
        && ! repeated_letter();
	}



	int main(void)
	{
    in = fopen("say.in", "r");
    out = fopen("say.out", "w");
    
    while (strcmp(fgets(word, sizeof(word), in), "end\n") != 0) {
        n = strlen(word) - 1;
        word[n] = '\0';
                
        fprintf(out, "<%s> is ", word);

        if (! can_say_it()) fprintf(out, "not ");
    
        fprintf(out, "acceptable.\n");
    }
        
    fclose(in);
    fclose(out);
    
    return 0;
	}