#include <bits/stdc++.h>
int check_notes(char *a) {
  if (strcmp(a, "C") == 0) return 12;
  if (strcmp(a, "C#") == 0) return 11;
  if (strcmp(a, "D") == 0) return 10;
  if (strcmp(a, "D#") == 0) return 9;
  if (strcmp(a, "E") == 0) return 8;
  if (strcmp(a, "F") == 0) return 7;
  if (strcmp(a, "F#") == 0) return 6;
  if (strcmp(a, "G") == 0) return 5;
  if (strcmp(a, "G#") == 0) return 4;
  if (strcmp(a, "A") == 0) return 3;
  if (strcmp(a, "B") == 0) return 2;
  if (strcmp(a, "H") == 0) return 1;
}
int main(void) {
  char A[5], B[5], C[5];
  int a, b, c, first_interval, secon_interval;
  int max, middle, min;
  int i;
  scanf("%s%s%s", A, B, C);
  a = check_notes(A);
  b = check_notes(B);
  c = check_notes(C);
  if (a > b && b > c) {
    max = a;
    middle = b;
    min = c;
  } else if (a > c && c > b) {
    max = a;
    middle = c;
    min = b;
  } else if (b > a && a > c) {
    max = b;
    middle = a;
    min = c;
  } else if (b > c && c > a) {
    max = b;
    middle = c;
    min = a;
  } else if (c > a && a > b) {
    max = c;
    middle = a;
    min = b;
  } else if (c > b && b > a) {
    max = c;
    middle = b;
    min = a;
  }
  if (max - middle == 4 && middle - min == 3)
    printf("major");
  else if (max - middle == 3 && middle - min == 4)
    printf("minor");
  else if (min + 12 - max == 4 && max - middle == 3)
    printf("major");
  else if (min + 12 - max == 3 && max - middle == 4)
    printf("minor");
  else if ((middle + 12) - (min + 12) == 4 && min + 12 - max == 3)
    printf("major");
  else if ((middle + 12) - (min + 12) == 3 && min + 12 - max == 4)
    printf("minor");
  else
    printf("strange");
}
