{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eVasya studies music. \u003c/p\u003e\u003cp\u003eHe has learned lots of interesting stuff. For example, he knows that there are 12 notes: \u003cspan class\u003d\"tex-font-style-tt\"\u003eC\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eC#\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eD\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eD#\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eE\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eF\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eF#\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eG\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eG#\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eA\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eB\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eH\u003c/span\u003e. He also knows that the notes are repeated cyclically: after \u003cspan class\u003d\"tex-font-style-tt\"\u003eH\u003c/span\u003e goes \u003cspan class\u003d\"tex-font-style-tt\"\u003eC\u003c/span\u003e again, and before \u003cspan class\u003d\"tex-font-style-tt\"\u003eC\u003c/span\u003e stands \u003cspan class\u003d\"tex-font-style-tt\"\u003eH\u003c/span\u003e. We will consider the \u003cspan class\u003d\"tex-font-style-tt\"\u003eC\u003c/span\u003e note in the row\u0027s beginning and the \u003cspan class\u003d\"tex-font-style-tt\"\u003eC\u003c/span\u003e note after the \u003cspan class\u003d\"tex-font-style-tt\"\u003eH\u003c/span\u003e similar and we will identify them with each other. The distance between the notes along the musical scale is measured in tones: between two consecutive notes there\u0027s exactly one semitone, that is, 0.5 tone. The distance is taken from the lowest tone to the uppest one, that is, the distance between \u003cspan class\u003d\"tex-font-style-tt\"\u003eC\u003c/span\u003e and \u003cspan class\u003d\"tex-font-style-tt\"\u003eE\u003c/span\u003e is 4 semitones and between \u003cspan class\u003d\"tex-font-style-tt\"\u003eE\u003c/span\u003e and \u003cspan class\u003d\"tex-font-style-tt\"\u003eC\u003c/span\u003e is 8 semitones\u003c/p\u003e\u003cp\u003eVasya also knows what a chord is. A chord is an unordered set of no less than three notes. However, for now Vasya only works with triads, that is with the chords that consist of exactly three notes. He can already distinguish between two types of triads — major and minor.\u003c/p\u003e\u003cp\u003eLet\u0027s define a major triad. Let the triad consist of notes \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eX\u003c/i\u003e\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eY\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eZ\u003c/i\u003e\u003c/span\u003e. If we can order the notes so as the distance along the musical scale between \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eX\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eY\u003c/i\u003e\u003c/span\u003e equals 4 semitones and the distance between \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eY\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eZ\u003c/i\u003e\u003c/span\u003e is 3 semitones, then the triad is major. The distance between \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eX\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eZ\u003c/i\u003e\u003c/span\u003e, accordingly, equals 7 semitones.\u003c/p\u003e\u003cp\u003eA minor triad is different in that the distance between \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eX\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eY\u003c/i\u003e\u003c/span\u003e should be 3 semitones and between \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eY\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eZ\u003c/i\u003e\u003c/span\u003e — 4 semitones.\u003c/p\u003e\u003cp\u003eFor example, the triad \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eC E G\u003c/span\u003e\" is major: between \u003cspan class\u003d\"tex-font-style-tt\"\u003eC\u003c/span\u003e and \u003cspan class\u003d\"tex-font-style-tt\"\u003eE\u003c/span\u003e are 4 semitones, and between \u003cspan class\u003d\"tex-font-style-tt\"\u003eE\u003c/span\u003e and \u003cspan class\u003d\"tex-font-style-tt\"\u003eG\u003c/span\u003e are 3 semitones. And the triplet \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eC# B F\u003c/span\u003e\" is minor, because if we order the notes as \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eB C# F\u003c/span\u003e\", than between \u003cspan class\u003d\"tex-font-style-tt\"\u003eB\u003c/span\u003e and \u003cspan class\u003d\"tex-font-style-tt\"\u003eC#\u003c/span\u003e will be 3 semitones, and between \u003cspan class\u003d\"tex-font-style-tt\"\u003eC#\u003c/span\u003e and \u003cspan class\u003d\"tex-font-style-tt\"\u003eF\u003c/span\u003e — 4 semitones.\u003c/p\u003e\u003cp\u003eHelp Vasya classify the triad the teacher has given to him.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe only line contains 3 space-separated notes in the above-given notation.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint \"\u003cspan class\u003d\"tex-font-style-tt\"\u003emajor\u003c/span\u003e\" if the chord is major, \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eminor\u003c/span\u003e\" if it is minor, and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003estrange\u003c/span\u003e\" if the teacher gave Vasya some weird chord which is neither major nor minor. Vasya promises you that the answer will always be unambiguous. That is, there are no chords that are both major and minor simultaneously.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eC E G\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003emajor\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eC# B F\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eminor\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eA B H\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003estrange\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}