#include <bits/stdc++.h>
using namespace std;
template <class T>
int len(const T &c) {
  return (int)c.size();
}
template <class T>
void cmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
void cmax(T &a, T b) {
  if (b > a) a = b;
}
map<string, int> m;
string s1, s2, s3;
int t1, t2;
int main() {
  m["C"] = 0;
  m["C#"] = 1;
  m["D"] = 2;
  m["D#"] = 3;
  m["E"] = 4;
  m["F"] = 5;
  m["F#"] = 6;
  m["G"] = 7;
  m["G#"] = 8;
  m["A"] = 9;
  m["B"] = 10;
  m["H"] = 11;
  cin >> s1 >> s2 >> s3;
  vector<string> v(3);
  v[0] = s1;
  v[1] = s3;
  v[2] = s2;
  sort(v.begin(), v.end());
  do {
    s1 = v[0];
    s2 = v[1];
    s3 = v[2];
    if (m[s2] < m[s1])
      t1 = (m[s2] + 11 - m[s1]) % 11 + 1;
    else
      t1 = m[s2] - m[s1];
    if (m[s3] < m[s2])
      t2 = (m[s3] + 11 - m[s2]) % 11 + 1;
    else
      t2 = m[s3] - m[s2];
    if (t1 == 4 && t2 == 3) {
      cout << "major";
      return 0;
    } else if (t1 == 3 && t2 == 4) {
      cout << "minor";
      return 0;
    }
  } while (next_permutation(v.begin(), v.end()));
  cout << "strange";
}
