#include <bits/stdc++.h>
using namespace std;
string n[12] = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "B", "H"};
int main() {
  map<string, int> notes;
  for (int i = 0; i < 12; i++) notes[n[i]] = i;
  string s1, s2, s3;
  while (cin >> s1 >> s2 >> s3) {
    int a[3] = {notes[s1], notes[s2], notes[s3]};
    sort(a, a + 3);
    bool f = 0;
    for (int i = 0; i < 3; i++) {
      if (((a[i] + 4) % 12) == ((a[(i + 1) % 3]) % 12) &&
          ((a[(i + 1) % 3] + 3) % 12) == ((a[(i + 2) % 3]) % 12)) {
        cout << "major" << endl;
        f = 1;
        break;
      }
    }
    if (f) continue;
    for (int i = 0; i < 3; i++) {
      if (((a[i] + 3) % 12) == ((a[(i + 1) % 3]) % 12) &&
          ((a[(i + 1) % 3] + 4) % 12) == ((a[(i + 2) % 3]) % 12)) {
        cout << "minor" << endl;
        f = 1;
        break;
      }
    }
    if (f)
      continue;
    else
      cout << "strange" << endl;
  }
  return 0;
}
