def artificial_inteligence() str = gets; temp = [] n = str.size temp << str[n - 2] temp << str[n - 1] if temp == 'ai' puts "#{str[0..n-2]}#{temp}" else puts "#{str[0..n-2]}-AI" end end artificial_inteligence()