#include <bits/stdc++.h>
using namespace std;
map<string, int> m;
int dis(string s1, string s2) { return (m[s1] - m[s2] + 12) % 12; }
string v[3];
string sol() {
  do {
    if (dis(v[0], v[1]) == 4 && dis(v[1], v[2]) == 3) return "minor";
    if (dis(v[0], v[1]) == 3 && dis(v[1], v[2]) == 4) return "major";
  } while (next_permutation(v, v + 3));
  return "strange";
}
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;
  while (cin >> v[0] >> v[1] >> v[2]) {
    sort(v, v + 3);
    cout << sol() << endl;
  }
  return 0;
}
