#include <bits/stdc++.h>
using namespace std;
map<string, int> mp;
int cha(int a, int b) {
  int c = 0;
  while (a != b) {
    c++;
    a++;
    if (a == 12) {
      a = 0;
    }
  }
  return c;
}
int main() {
  mp["C"] = 0;
  mp["C#"] = 1;
  mp["D"] = 2;
  mp["D#"] = 3;
  mp["E"] = 4;
  mp["F"] = 5;
  mp["F#"] = 6;
  mp["G"] = 7;
  mp["G#"] = 8;
  mp["A"] = 9;
  mp["B"] = 10;
  mp["H"] = 11;
  string a[3];
  cin >> a[0] >> a[1] >> a[2];
  sort(a, a + 3);
  do {
    if (cha(mp[a[0]], mp[a[1]]) == 4 && cha(mp[a[1]], mp[a[2]]) == 3) {
      cout << "major" << endl;
      return 0;
    }
    if (cha(mp[a[0]], mp[a[1]]) == 3 && cha(mp[a[1]], mp[a[2]]) == 4) {
      cout << "minor" << endl;
      return 0;
    }
  } while (next_permutation(a, a + 3));
  cout << "strange" << endl;
  return 0;
}
