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