#include <bits/stdc++.h>
using namespace std;
string a;
int la;
int b[3];
int c[3];
int Nu() {
  la = a.length();
  if (a[0] == 'C') {
    if (la == 1)
      return 0;
    else
      return 1;
  } else if (a[0] == 'D') {
    if (la == 1)
      return 2;
    else
      return 3;
  } else if (a[0] == 'E')
    return 4;
  else if (a[0] == 'F') {
    if (la == 1)
      return 5;
    else
      return 6;
  } else if (a[0] == 'G') {
    if (la == 1)
      return 7;
    else
      return 8;
  } else if (a[0] == 'A')
    return 9;
  else if (a[0] == 'B')
    return 10;
  else
    return 11;
}
int Dif(int x, int y) {
  if (x < y)
    return y - x;
  else
    return 12 - x + y;
}
int main() {
  for (int i = 0; i < 3; i++) {
    cin >> a;
    c[i] = Nu();
  }
  bool major = false;
  bool minor = false;
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++)
      if (i != j) {
        b[0] = c[i];
        b[1] = c[j];
        b[2] = c[3 - i - j];
        if (Dif(b[0], b[1]) == 4 && Dif(b[1], b[2]) == 3 &&
            Dif(b[0], b[2]) == 7)
          major = true;
        else if (Dif(b[0], b[1]) == 3 && Dif(b[1], b[2]) == 4 &&
                 Dif(b[0], b[2]) == 7)
          minor = true;
      }
  if (major)
    cout << "major";
  else if (minor)
    cout << "minor";
  else
    cout << "strange";
  return 0;
}
