line = gets.chomp if /ai$/ =~ line line = line.chop.chop line += "AI" else line += "-AI" end puts line