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