#include <bits/stdc++.h>
using namespace std;
char a[1000];
int b[100];
int main() {
  int i = 0;
  int j = 0;
  for (j = 0; j < 3; j++) {
    scanf("%s", a);
    i = 0;
    switch (a[i]) {
      case 'A':
        b[j] = 0;
        break;
      case 'B':
        b[j] = 1;
        break;
      case 'H':
        b[j] = 2;
        break;
      case 'C':
        if (a[i + 1] == '#')
          b[j] = 4;
        else
          b[j] = 3;
        break;
      case 'D':
        if (a[i + 1] == '#')
          b[j] = 6;
        else
          b[j] = 5;
        break;
      case 'E':
        b[j] = 7;
        break;
      case 'F':
        if (a[i + 1] == '#')
          b[j] = 9;
        else
          b[j] = 8;
        break;
      case 'G':
        if (a[i + 1] == '#')
          b[j] = 11;
        else
          b[j] = 10;
        break;
    };
  }
  sort(b, b + 3);
  if ((b[1] - b[0] == 3 && b[2] - b[1] == 4) ||
      (b[1] - b[0] == 5 && b[2] - b[1] == 3) ||
      (b[1] - b[0] == 4 && b[2] - b[1] == 5))
    printf("minor\n");
  else if ((b[1] - b[0] == 4 && b[2] - b[1] == 3) ||
           (b[1] - b[0] == 5 && b[2] - b[1] == 4) ||
           (b[1] - b[0] == 3 && b[2] - b[1] == 5))
    printf("major\n");
  else
    printf("strange\n");
  return 0;
}
