//Stephanie Yu //Senior Division //James E. Taylor High School import static java.lang.System.*; import java.io.*; import java.util.*; public class SYuACSL2{ static Scanner in; static String nl(){return in.nextLine();} static String[][] step1 = {{"AE", "GN", "KN", "PN", "WR"}, {"X"}, {"WH"}}; static String[][] step2 = {{"SCI", "SCY"}, {"CIA", "CH", "CI", "CE", "CY"}, {"DGE", "DGY", "DG"}, {"SH", "SIO", "SIA"}, {"TIA", "TIO"}}; static String vowels = "AEIOU"; static String consonant = "BCDGHPQSTVWYZ"; static String firstStep(String word){ boolean changed = false; o: for (int i = 0; i0 && check(word.substring(i-1), step2[0]))?remove(word, i):((check(word.substring(i), step2[1]))?replaceAt(word, i, "X"):replaceAt(word, i, "K")); break; case 'D' : word = (check(word.substring(i), step2[2]))?replaceAt(word, i, "J"):replaceAt(word, i, "T"); break; case 'G' : word = (i>0&&(vowels.contains(""+word.charAt(i-1)) && (i==word.length()-1||!vowels.contains(""+word.charAt(i+1)))))?remove(word, i):((i0&&(((vowels.contains(""+word.charAt(i-1))) && (i==word.length()-1||!vowels.contains(""+word.charAt(i+1)))) || "CSPTG".contains(""+word.charAt(i-1))))?remove(word, i): word; break; case 'P' : word = (i