#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<string> s;
  map<string, int> mp;
  int ans = 0;
  string x, mem[12] = {"C",  "C#", "D",  "D#", "E", "F",
                       "F#", "G",  "G#", "A",  "B", "H"};
  for (int i = 0; i < 12; i++) mp[mem[i]] = i;
  for (int i = 0; i < 3; i++) cin >> x, s.push_back(x);
  for (int i = 0; i < 6; i++) {
    if ((mp[s[0]] + 4) % 12 == mp[s[1]] && (mp[s[1]] + 3) % 12 == mp[s[2]] &&
        (mp[s[0]] + 7) % 12 == mp[s[2]])
      ans = 1;
    else if ((mp[s[0]] + 3) % 12 == mp[s[1]] &&
             (mp[s[1]] + 4) % 12 == mp[s[2]] && (mp[s[0]] + 7) % 12 == mp[s[2]])
      ans = 2;
    next_permutation(s.begin(), s.end());
  }
  if (ans == 1)
    cout << "major" << endl;
  else if (ans == 2)
    cout << "minor" << endl;
  else
    cout << "strange" << endl;
  return 0;
}
