|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||512 MB||20||14||14||70.000%|
Recently discovered on a distant planet, a race of aliens has music a bit like ours (notes A, B, C, D, E, F and G) but without any sharps or flats. Like our music, after G they start again at A.
To these aliens, beautiful music is any sequence of notes where the difference between 1 note and the next is 2, 4 or 6 notes above the previous note. Anything else is discordant and causes them discomfort.
Each line of input contains a set of N notes with no spaces between them (0 < N <= 21). Each note will be one of the upper case letters between A and G inclusive. The final line of input will be a # symbol on its own. Do not process this line.
You must assume that a note is the next note of that letter above the previous note.
For each line of input, if the notes follow the rule for being beautiful music, your output should be
That music is beautiful.
Otherwise, the output should be
Ouch! That hurts my ears.
A C ACE ABC ACD CEB EAF EBFA #
That music is beautiful. That music is beautiful. That music is beautiful. Ouch! That hurts my ears. Ouch! That hurts my ears. That music is beautiful. Ouch! That hurts my ears. That music is beautiful.