#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
int main() {
  vector<string> dic = {"C",  "C#", "D",  "D#", "E", "F",
                        "F#", "G",  "G#", "A",  "B", "H"};
  vector<int> temp(3);
  for (int i = 0; i < 3; i++) {
    string s;
    cin >> s;
    for (auto it = 0; it < 12; it++) {
      if (dic[it] == s) {
        temp[i] = it + 1;
        break;
      }
    }
  }
  sort(temp.begin(), temp.end());
  do {
    vector<int> ans;
    for (int i = 1; i < 3; i++) {
      if (temp[i] > temp[i - 1]) {
        ans.push_back(temp[i] - temp[i - 1]);
      } else {
        int res = 0;
        int from = temp[i - 1];
        while (from != temp[i]) {
          from++;
          from %= 12;
          res++;
        }
        ans.push_back(res);
      }
    }
    if (ans[0] == 4 && ans[1] == 3) {
      cout << "major\n";
      return 0;
    } else if (ans[0] == 3 && ans[1] == 4) {
      cout << "minor\n";
      return 0;
    }
  } while (next_permutation(temp.begin(), temp.end()));
  cout << "strange\n";
}
