public class Main {
public static boolean check(char c){
switch (c){
case 'a':
return true;
case 'e':
return true;
case 'y':
return true;
case 'u':
return true;
case 'i':
return true;
case 'o':
return true;
}
return false;
}
public static String[] stats = {"MOD", "NOMOD"};
public static void main(String[] args) {
String s = "applle", current = stats[0];
char c[] = s.toCharArray();
for (int i = 0; i<s.length(); i++){
if (!(((c[i] >= 'a')&&(c[i] <= 'z')) || ((c[i] >= 'A')&&(c[i] <= 'Z')))) {
System.out.println("Met glas");
break;
}
if ((check(c[i])))
switch (current) {
case "MOD": current = "NOMOD";
System.out.println("Met soglas, now is mod2");
break;
case "NOMOD": current = "MOD";
System.out.println("Met soglas, now is nomod");
break;
}
if (current == "MOD") current = "NOMOD";
else
current = "MOD";
}
System.out.println(current);
}
}