#include <bits/stdc++.h>
using namespace std;
string s[111], s1, s2, s3;
long long d[11111];
int main() {
  s[0] = "C";
  s[1] = "C#";
  s[2] = "D";
  s[3] = "D#";
  s[4] = "E";
  s[5] = "F";
  s[6] = "F#";
  s[7] = "G";
  s[8] = "G#";
  s[9] = "A";
  s[10] = "B";
  s[11] = "H";
  cin >> s1 >> s2 >> s3;
  for (int i = 0; i < 12; ++i) {
    if (s1 == s[i] || s2 == s[i] || s3 == s[i]) {
      d[i] = 1;
    }
  }
  for (int i = 0; i < 12; ++i) {
    if (d[i]) {
      if (d[(i + 7) % 12] && d[(i + 4) % 12]) {
        cout << "major";
        return 0;
      }
      if (d[(i + 7) % 12] && d[(i + 3) % 12]) {
        cout << "minor";
        return 0;
      }
    }
  }
  cout << "strange";
  return 0;
}
