#include <bits/stdc++.h>
using namespace std;
int check(string str) {
  string note[] = {"C",  "C#", "D",  "D#", "E", "F",
                   "F#", "G",  "G#", "A",  "B", "H"};
  for (int i = 0; i <= 12; i++) {
    if (str == note[i]) {
      return i;
    }
  }
}
int main() {
  int s1, s2, s3;
  string str, str1, str2;
  cin >> str >> str1 >> str2;
  s1 = check(str);
  s2 = check(str1);
  s3 = check(str2);
  int temp;
  if (s1 > s2) {
    temp = s1;
    s1 = s2;
    s2 = temp;
  }
  if (s1 > s3) {
    temp = s1;
    s1 = s3;
    s3 = temp;
  }
  if (s2 > s3) {
    temp = s2;
    s2 = s3;
    s3 = temp;
  }
  if (s2 - s1 == 4 && s3 - s2 == 3) {
    cout << "major" << endl;
  } else if (s2 - s1 == 3 && s3 - s2 == 4) {
    cout << "minor" << endl;
  } else if (12 - s3 + s1 == 4 && s2 - s1 == 3 && 12 - s3 + s2 == 7) {
    cout << "major" << endl;
  } else if (12 - s3 + s1 == 3 && s2 - s1 == 4 && 12 - s3 + s2 == 7)
    cout << "minor" << endl;
  else if (s3 - s2 == 4 && 12 - s3 + s1 == 3 && 12 - s2 + s1 == 7)
    cout << "major" << endl;
  else if (s3 - s2 == 3 && 12 - s3 + s1 == 4 && 12 - s2 + s1 == 7)
    cout << "minor" << endl;
  else
    cout << "strange" << endl;
  return 0;
}
