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