#include <bits/stdc++.h>
using namespace std;
int distance(int a, int b) {
  if (a < b)
    return b - a;
  else
    return 12 - a + b;
}
map<string, int> a;
bool cmp(string x, string y) { return a[x] < a[y]; }
int main(int argc, char const *argv[]) {
  int tem = 1;
  string b[12] = {"C",  "C#", "D",  "D#", "E", "F",
                  "F#", "G",  "G#", "A",  "B", "H"};
  for (int i = 0; i < 12; i++) a[b[i]] = tem++;
  string s[3];
  for (int i = 0; i < 3; i++) cin >> s[i];
  sort(s, s + 3);
  do {
    int di1 = distance(a[s[0]], a[s[1]]);
    int di2 = distance(a[s[1]], a[s[2]]);
    if (di1 == 4 && di2 == 3) {
      cout << "major";
      return 0;
    } else if (di1 == 3 && di2 == 4) {
      cout << "minor";
      return 0;
    }
  } while (next_permutation(s, s + 3));
  cout << "strange";
  return 0;
}
