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