Veronica attends a music academy. She was given a music sheet of a composition with only notes (without annotations), and needs to recognise the scale used. In this problem, we will limit ourselves to only the two most frequently used (and usually taught in schools first) scales: -minor and -major. This doesn't make them simpler or more basic than other minor and major scales – all minor scales are mutually equivalent save for translation, and so are major scales.
Still, out of the tones of an octave used in modern music, -minor and -major scales do use the tones with shortest names: -minor is defined as an ordered septuple , and -major as .
Notice that the sets of tones of these two scales are equal. What's the difference? The catch is that not only the set of tones, but also their usage, determines a scale. Specifically, the tonic (the first tone of a scale), subdominant (the fourth tone) and dominant (the fifth tone) are the primary candidates for accented tones in a composition. In -minor, these are , , and , and in -major, they are , , and . We will name these tones main tones.
Aren't the scales still equivalent save for translation? They are not: for example, the third tone of -minor is three half-tones higher than the tonic , while the third tone of -major is four halftones higher than the tonic . The difference, therefore, lies in the intervals. This makes minor scales "sad" and major scales "happy".
Write a program to decide if a composition is more likely written in -minor or -major by counting whether there are more main tones of -minor or of -major among the accented tones (the first tones in each measure). If there is an equal number of main tones, determine the scale based on the last tone (which is guaranteed to be either for -minor or for -major in any such test case).
For example, examine the well-known melody "Frère Jacques":
| separates measures, so the accented tones are, in order: . Ten of them are main tones of -major, while six are main tones of -minor. Therefore, our best estimate is that the song was written in
The first and only line of input contains a sequence of at least , and at most , characters from the
|. This is a simplified notation for a composition, where
| separates measures. The characters
| will never appear adjacent to one another, at
the beginning, or at the end of the sequence.
The first and only line of output must contain the text
C-dur (for -major) or
A-mol (for -minor).
Sample Input 1
Sample Output 1
Sample Input 2
Sample Output 2