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