#include <bits/stdc++.h>
using namespace std;
string s[3];
map<string, int> m;
int dis(string s1, string s2) { return (m[s2] - m[s1] + 12) % 12; }
int main() {
  m["C"] = 0;
  m["C#"] = 1;
  m["D"] = 2;
  m["D#"] = 3;
  m["E"] = 4;
  m["F"] = 5;
  m["F#"] = 6;
  m["G"] = 7;
  m["G#"] = 8;
  m["A"] = 9;
  m["B"] = 10;
  m["H"] = 11;
  cin >> s[0] >> s[1] >> s[2];
  sort(s, s + 3);
  do {
    if (dis(s[0], s[1]) == 4 && dis(s[1], s[2]) == 3) {
      cout << "major\n";
      return 0;
    }
    if (dis(s[0], s[1]) == 3 && dis(s[1], s[2]) == 4) {
      cout << "minor\n";
      return 0;
    }
  } while (next_permutation(s, s + 3));
  cout << "strange\n";
}
