s=gets.chomp.split(',') for s in s if s != 'AC' puts 'Failed...' exit end end puts 'Done!'