#include <bits/stdc++.h>
char s1[5], s2[5], s3[5];
int w(char c[]) {
  if (strcmp(c, "C") == 0) return 12;
  if (strcmp(c, "C#") == 0) return 11;
  if (strcmp(c, "D") == 0) return 10;
  if (strcmp(c, "D#") == 0) return 9;
  if (strcmp(c, "E") == 0) return 8;
  if (strcmp(c, "F") == 0) return 7;
  if (strcmp(c, "F#") == 0) return 6;
  if (strcmp(c, "G") == 0) return 5;
  if (strcmp(c, "G#") == 0) return 4;
  if (strcmp(c, "A") == 0) return 3;
  if (strcmp(c, "B") == 0) return 2;
  if (strcmp(c, "H") == 0) return 1;
  return 0;
}
int main() {
  int ab, bc, ac, ba, ca, cb;
  scanf("%s%s%s", &s1, &s2, &s3);
  ab = w(s1) - w(s2);
  if (ab < 0) ab += 12;
  bc = w(s2) - w(s3);
  if (bc < 0) bc += 12;
  ac = w(s1) - w(s3);
  if (ac < 0) ac += 12;
  cb = w(s3) - w(s2);
  if (cb < 0) cb += 12;
  ca = w(s3) - w(s1);
  if (ca < 0) ca += 12;
  ba = w(s2) - w(s1);
  if (ba < 0) ba += 12;
  if ((cb == 4 && ba == 3) || (ab == 4 && bc == 3) || (ac == 4 && cb == 3) ||
      (bc == 4 && ca == 3) || (ba == 4 && ac == 3) || (ca == 4 && ab == 3))
    printf("major\n");
  else if ((ab == 3 && bc == 4) || (ac == 3 && cb == 4) ||
           (bc == 3 && ca == 4) || (ba == 3 && ac == 4) ||
           (ca == 3 && ab == 4) || (cb == 3 && ba == 4))
    printf("minor\n");
  else
    printf("strange\n");
  return 0;
}
