#include <bits/stdc++.h>
using namespace std;
string arr[24] = {"C",  "C#", "D",  "D#", "E", "F",
                  "F#", "G",  "G#", "A",  "B", "H"};
int positin(string look) {
  for (int i = 0; i < 12; i++) {
    if (look == arr[i]) return i;
  }
}
int main() {
  string in1, in2, in3;
  int res1, res2, inp1, inp2, inp3;
  cin >> in1 >> in2 >> in3;
  inp1 = positin(in1);
  inp2 = positin(in2);
  inp3 = positin(in3);
  int arry[3] = {inp1, inp2, inp3};
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      for (int i = 0; i < 3; i++) {
        if (j != i) {
          inp1 = arry[i], inp2 = arry[j];
          res1 = inp1 - inp2;
          if (res1 == 3 || res1 == 9 || res1 == -9) {
            for (int s = 0; s < 3; s++) {
              if (s != i && s != j) {
                res2 = arry[s] - arry[i];
                if (res2 == 4 || res2 == 8 || res2 == -8) {
                  cout << "minor" << endl;
                  return 0;
                }
              }
            }
          } else if (res1 == 4 || res1 == 8 || res1 == -8) {
            for (int s = 0; s < 3; s++) {
              if (s != i && s != j) {
                res2 = arry[s] - arry[i];
                if (res2 == 3 || res2 == 9 || res2 == -9) {
                  cout << "major" << endl;
                  return 0;
                }
              }
            }
          }
        }
      }
    }
  }
  cout << "strange" << endl;
  return 0;
}
