// Phil Dexheimer
// 7/23/02
#include <fstream.h>
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

void main()
{
 ifstream fin("words.in");
 char word[30], *p;
 int i, legal;
 while (fin >> word)
  {
   //By default, the word's not legal
   legal = 0;

   //Step through, char by char, and quit if we find a vowel or reach the end
   for(i=0;!legal && word[i];i++)
     //If the lower case form of this letter is a vowel, the word's legal
     if (strchr("aeiouy", tolower(word[i])))
       legal = 1;

   printf("%s is %slegal\n", word, legal ? "" : "not ");
  }
  fin.close();
}


