#include <bits/stdc++.h>
using namespace std;
string mas[12] = {"C",  "C#", "D",  "D#", "E", "F",
                  "F#", "G",  "G#", "A",  "B", "H"};
string mas1[3];
int mas2[3];
int fun1(int, int, int);
bool cmp(int, int);
int main() {
  for (int i = 0; i < 3; ++i) cin >> mas1[i];
  for (int i = 0; i < 12; ++i) {
    if (mas1[0] == mas[i]) mas2[0] = i;
    if (mas1[1] == mas[i]) mas2[1] = i;
    if (mas1[2] == mas[i]) mas2[2] = i;
  }
  sort(mas2, mas2 + 3, cmp);
  int tmp = 0;
  tmp = fun1(mas2[0], mas2[1], mas2[2]);
  if (tmp == 3) {
    tmp = fun1(mas2[1], mas2[2], mas2[0] + 12);
    if (tmp == 3) {
      tmp = fun1(mas2[2], mas2[0] + 12, mas2[1] + 12);
      if (tmp == 3) {
        tmp = fun1(mas2[2] - 12, mas2[0], mas2[1]);
        if (tmp == 3) tmp = fun1(mas2[1] - 12, mas2[2] - 12, mas2[0]);
      }
    }
  }
  if (tmp == 1) cout << "major";
  if (tmp == 2) cout << "minor";
  if (tmp == 3) cout << "strange";
  return 0;
}
int fun1(int a, int b, int c) {
  if (b - a == 4 && c - b == 3) return 1;
  if (b - a == 3 && c - b == 4) return 2;
  return 3;
}
bool cmp(int a, int b) { return a < b; }
