#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> chord;
  string s1, s2, s3;
  int count = 0, falg1 = 0, falg2 = 0, index1, index2, index3, index11, index22,
      index33;
  cin >> s1 >> s2 >> s3;
  chord["C"] = 1;
  chord["C#"] = 2;
  chord["D"] = 3;
  chord["D#"] = 4;
  chord["E"] = 5;
  chord["F"] = 6;
  chord["F#"] = 7;
  chord["G"] = 8;
  chord["G#"] = 9;
  chord["A"] = 10;
  chord["B"] = 11;
  chord["H"] = 12;
  index11 = index1 = chord[s1];
  index2 = index22 = chord[s2];
  index3 = index33 = chord[s3];
  for (int i = 0; i < 3; i++) {
    if (i == 0) {
      count = 0;
      falg1 = 0;
      falg2 = 0;
      while (falg1 == 0 || falg2 == 0) {
        index11++;
        count++;
        if (index11 == 13) index11 = 1;
        if (index11 == index2 || index11 == index3) {
          if (falg1 == 0)
            falg1 = count;
          else
            falg2 = count;
          count = 0;
        }
      }
      if (falg1 == 3 && falg2 == 4) {
        cout << "minor" << endl;
        exit(0);
      } else if (falg1 == 4 && falg2 == 3) {
        cout << "major" << endl;
        exit(0);
      }
    }
    if (i == 1) {
      count = 0;
      falg1 = 0;
      falg2 = 0;
      while (falg1 == 0 || falg2 == 0) {
        index22++;
        count++;
        if (index22 == 13) index22 = 1;
        if (index22 == index1 || index22 == index3) {
          if (falg1 == 0)
            falg1 = count;
          else
            falg2 = count;
          count = 0;
        }
      }
      if (falg1 == 3 && falg2 == 4) {
        cout << "minor" << endl;
        exit(0);
      } else if (falg1 == 4 && falg2 == 3) {
        cout << "major" << endl;
        exit(0);
      }
    }
    if (i == 2) {
      count = 0;
      falg1 = 0;
      falg2 = 0;
      while (falg1 == 0 || falg2 == 0) {
        index33++;
        count++;
        if (index33 == 13) index33 = 1;
        if (index33 == index1 || index33 == index2) {
          if (falg1 == 0)
            falg1 = count;
          else
            falg2 = count;
          count = 0;
        }
      }
      if (falg1 == 3 && falg2 == 4) {
        cout << "minor" << endl;
        exit(0);
      } else if (falg1 == 4 && falg2 == 3) {
        cout << "major" << endl;
        exit(0);
      } else {
        cout << "strange" << endl;
      }
    }
  }
}
