#include <bits/stdc++.h>
using namespace std;
int majmin(char ss[]) {
  if (strcmp(ss, "C") == 0) return 0;
  if (strcmp(ss, "C#") == 0) return 1;
  if (strcmp(ss, "D") == 0) return 2;
  if (strcmp(ss, "D#") == 0) return 3;
  if (strcmp(ss, "E") == 0) return 4;
  if (strcmp(ss, "F") == 0) return 5;
  if (strcmp(ss, "F#") == 0) return 6;
  if (strcmp(ss, "G") == 0) return 7;
  if (strcmp(ss, "G#") == 0) return 8;
  if (strcmp(ss, "A") == 0) return 9;
  if (strcmp(ss, "B") == 0) return 10;
  if (strcmp(ss, "H") == 0) return 11;
}
int main() {
  char s[11], s1[5], s2[5], s3[5];
  gets(s);
  sscanf(s, "%s%s%s", s1, s2, s3);
  int a = majmin(s1), b = majmin(s2), c = majmin(s3);
  vector<int> vc;
  vc.push_back(a), vc.push_back(b), vc.push_back(c);
  sort(vc.begin(), vc.end());
  vc.push_back(vc[0] + 12);
  if ((vc[1] - vc[0] == 4 && vc[2] - vc[1] == 3) ||
      (vc[2] - vc[1] == 4 && vc[3] - vc[2] == 3) ||
      (vc[3] - vc[2] == 4 && vc[1] - vc[0] == 3))
    printf("major\n");
  else if ((vc[1] - vc[0] == 3 && vc[2] - vc[1] == 4) ||
           (vc[2] - vc[1] == 3 && vc[3] - vc[2] == 4) ||
           (vc[3] - vc[2] == 3 && vc[1] - vc[0] == 4))
    printf("minor\n");
  else
    printf("strange\n");
  return 0;
}
