package yukicoder; import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class No536 { public static void main(String[] args) { String s = new Scanner(System.in).next(); Pattern p = Pattern.compile("ai$"); Matcher m = p.matcher(s); if( m.find() ) { System.out.println(s.substring(0, s.length() - 2) + "AI"); } else { System.out.println(s + "-AI"); } } }