#include <bits/stdc++.h>
int n[3];
char notes[15][3] = {{"C"},  {"C#"}, {"D"},  {"D#"}, {"E"}, {"F"},
                     {"F#"}, {"G"},  {"G#"}, {"A"},  {"B"}, {"H"}};
int dis(int n1, int n2) { return (n1 < n2) ? n2 - n1 : 12 - n1 + n2; }
int con(char n[]) {
  for (int i = 0; i < 12; i++)
    if (!(strcmp(n, notes[i]))) return i + 1;
}
bool C(int i, int j, int k) {
  if (dis(n[i], n[j]) == 3 && dis(n[j], n[k]) == 4) {
    puts("minor");
    return true;
  }
  if (dis(n[i], n[j]) == 4 && dis(n[j], n[k]) == 3) {
    puts("major");
    return true;
  }
  return false;
}
int main() {
  int i, j, k;
  char s[3];
  scanf(" %s", s);
  n[0] = con(s);
  scanf(" %s", s);
  n[1] = con(s);
  scanf(" %s", s);
  n[2] = con(s);
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      if (j == i) continue;
      for (k = 0; k < 3; k++) {
        if (k == j || k == i) continue;
        if (C(i, j, k)) return 0;
      }
    }
  }
  puts("strange");
  return 0;
}
