#include <bits/stdc++.h>
using namespace std;
short steps(short x, short y) {
  short i = 0;
  while (x != y) {
    i++;
    x++;
    if (x > 12)
      x = 1;
    else if (i > 4)
      break;
  }
  return i;
}
int main() {
  short tones[3];
  for (short q = 0; q < 3; q++) {
    string x;
    cin >> x;
    if (x == "C")
      tones[q] = 1;
    else if (x == "C#")
      tones[q] = 2;
    else if (x == "D")
      tones[q] = 3;
    else if (x == "D#")
      tones[q] = 4;
    else if (x == "E")
      tones[q] = 5;
    else if (x == "F")
      tones[q] = 6;
    else if (x == "F#")
      tones[q] = 7;
    else if (x == "G")
      tones[q] = 8;
    else if (x == "G#")
      tones[q] = 9;
    else if (x == "A")
      tones[q] = 10;
    else if (x == "B")
      tones[q] = 11;
    else if (x == "H")
      tones[q] = 12;
  }
  bool found = false;
  sort(tones, tones + 3);
  do {
    if (steps(tones[0], tones[1]) == 3 && steps(tones[1], tones[2]) == 4) {
      cout << "minor\n";
      return 0;
    } else if (steps(tones[0], tones[1]) == 4 &&
               steps(tones[1], tones[2]) == 3) {
      cout << "major\n";
      return 0;
    }
  } while (next_permutation(tones, tones + 3));
  cout << "strange" << endl;
  return 0;
}
