#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-11;
const int INFINITE = 0x3f3f3f3f;
template <class T>
inline void checkmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
inline T lowbit(T n) {
  return (n ^ (n - 1)) & n;
}
template <class T>
inline int countbit(T n) {
  return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}
typedef vector<int> VI;
typedef vector<VI> VII;
typedef vector<string> VS;
VS chords;
int Find(string s) {
  for (int i = (int)(0); i < (int)(chords.size()); i++) {
    if (s == chords[i]) {
      return i;
    }
  }
  return -1;
}
int mod(int v, int m) {
  if (v > 0) return v % m;
  while (v < m) {
    v += m;
  }
  return v - m;
}
string check(VS combo) {
  int a = Find(combo[0]);
  int b = Find(combo[1]);
  int c = Find(combo[2]);
  if (a == -1 || b == -1 || c == -1) {
    return "";
  }
  int len = chords.size();
  if (mod(b - a, len) == 4 && mod(c - b, len) == 3)
    return "major";
  else if (mod(b - a, len) == 3 && mod(c - b, len) == 4)
    return "minor";
  else
    return "";
}
int main() {
  chords.push_back("C");
  chords.push_back("C#");
  chords.push_back("D");
  chords.push_back("D#");
  chords.push_back("E");
  chords.push_back("F");
  chords.push_back("F#");
  chords.push_back("G");
  chords.push_back("G#");
  chords.push_back("A");
  chords.push_back("B");
  chords.push_back("H");
  string a, b, c;
  cin >> a >> b >> c;
  string res;
  VS combos;
  combos.push_back(a);
  combos.push_back(b);
  combos.push_back(c);
  res = check(combos);
  if (res == "major" || res == "minor") {
    cout << res << endl;
    return 0;
  }
  combos.clear();
  combos.push_back(a);
  combos.push_back(c);
  combos.push_back(b);
  res = check(combos);
  if (res == "major" || res == "minor") {
    cout << res << endl;
    return 0;
  }
  combos.clear();
  combos.push_back(b);
  combos.push_back(a);
  combos.push_back(c);
  res = check(combos);
  if (res == "major" || res == "minor") {
    cout << res << endl;
    return 0;
  }
  combos.clear();
  combos.push_back(b);
  combos.push_back(c);
  combos.push_back(a);
  res = check(combos);
  if (res == "major" || res == "minor") {
    cout << res << endl;
    return 0;
  }
  combos.clear();
  combos.push_back(c);
  combos.push_back(a);
  combos.push_back(b);
  res = check(combos);
  if (res == "major" || res == "minor") {
    cout << res << endl;
    return 0;
  }
  combos.clear();
  combos.push_back(c);
  combos.push_back(b);
  combos.push_back(a);
  res = check(combos);
  if (res == "major" || res == "minor") {
    cout << res << endl;
    return 0;
  }
  if (res == "") {
    cout << "strange\n";
  }
  return 0;
}
