#include <bits/stdc++.h>
using namespace std;
const int sto = 103;
char c, ch[3][2];
int t[3];
int main() {
  map<string, int> ton;
  ton["C"] = 0;
  ton["C#"] = 1;
  ton["D"] = 2;
  ton["D#"] = 3;
  ton["E"] = 4;
  ton["F"] = 5;
  ton["F#"] = 6;
  ton["G"] = 7;
  ton["G#"] = 8;
  ton["A"] = 9;
  ton["B"] = 10;
  ton["H"] = 11;
  for (int i = 0; i <= 2; ++i) {
    scanf("%s", &ch[i]);
    t[i] = ton[(string)ch[i]];
  }
  sort(t, t + 3);
  int r1 = (t[1] - t[0] + 12) % 12;
  int r2 = (t[2] - t[1] + 12) % 12;
  int r3 = (t[0] - t[2] + 12) % 12;
  if ((r1 == 3 && r2 == 4) || (r2 == 3 && r3 == 4) || (r3 == 3 && r1 == 4))
    printf("minor");
  else if ((r1 == 4 && r2 == 3) || (r2 == 4 && r3 == 3) || (r3 == 4 && r1 == 3))
    printf("major");
  else
    printf("strange");
  if (0) {
    scanf("%c", &c);
    scanf("%c", &c);
  }
  return 0;
}
