1. 
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/*
* ACM Programming Contest
*
* Problem: 492 Pig Latin
* Status: Wrong Answer
* Run Time: 0.760
* Date: 2009-05-25
* Author: Simon Baumgartner
*/

public class Main {

public static void main(String[] args) throws IOException {

Pattern pattern = Pattern.compile("^(a|e|i|o|u).*", Pattern.CASE_INSENSITIVE);
Pattern wordPattern = Pattern.compile("[a-zA-Z]+");
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = in.readLine();
do{
int start = 0;
int end = 0;
Matcher matcher = wordPattern.matcher(line);
while(matcher.find()){
start = matcher.start();
// print whatever was between old word and new word
System.out.print(line.substring(end, start));
end = matcher.end();
String word = line.substring(start, end);
if(pattern.matcher(word).matches())
System.out.print(word + "ay");
else if(word.length() >= 1)
System.out.print(word.substring(1) + word.charAt(0) + "ay");
}
System.out.println(line.substring(end));
}while((line = in.readLine() ) != null);
}
}