All submissions for this problem are available.
Ayan's favourite musical instrument is the keyboard. He practices regularly as well, you can hear him playing even at 3 or 4 in the night.
Unfortunately, he got into a fight in his room and his keyboard was damaged beyond repair. However, being a rich fellow he quickly ordered another one.
But this time he felt a bit adventurous. He decided to buy a circular keyboard i.e keys are arranged in a circle.
This funky keyboard has only 12 keys though - C,C#,D,D#,E,F,F#,G,G#,A,B and S.
Since the layout is quite different to what he is used to, he needs to relearn basics of music theory again.
Firstly, a semitone is the distance between any two keys. So there are 3 semitones between D and F, and 2 semitones between S and C# (remember it is circular!)
He knows a chord is an unordered set of three or more than three keys. However, Ayan wants to start slow and considers only triads - chords of size 3.
Triads come in two varieties - major and minor. In a major triad the number of semitones between the first and second key is 4, and between the second and third - 3.
Minor triads on the other hand have 3 semitones between the first and second keys, 4 semitones between the second and third one.
For example, D F# A is a major triad, while D F A is minor.
Ayan needs your help classifying some basic triads. Kindly help him.
The first line of input is the number of test cases T (1<=T<=25).
The next T lines contain three characters corresponding to the musical keys on the circular keyboard.
Note that # keys will be given as small letters and normal keys as capital letters. So C# will be given as c, while D will remain D.
It is guaranteed that the triads will be either major or minor.
For each test case, print "Major" or "Minor" in a separate line, depending on whether the given triad is major or minor.
E G S
S d f
Example case 1. E and G have a 3 semitone gap, while G and S have a 4 semitone gap. So Minor.
S and D# have a 4 semitone gap (remember circular) and D# and F# have a 3 semitone gap. So Major.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions