#include <bits/stdc++.h>
using namespace std;
int main() {
  int v[3];
  string s[3];
  int alist[6] = {0, 0, 1, 1, 2, 2};
  int blist[6] = {1, 2, 2, 0, 0, 1};
  int clist[6] = {2, 1, 0, 2, 1, 0};
  for (int i = 0; i < 3; i++) {
    cin >> s[i];
    if (s[i] == "C") v[i] = 0;
    if (s[i] == "C#") v[i] = 1;
    if (s[i] == "D") v[i] = 2;
    if (s[i] == "D#") v[i] = 3;
    if (s[i] == "E") v[i] = 4;
    if (s[i] == "F") v[i] = 5;
    if (s[i] == "F#") v[i] = 6;
    if (s[i] == "G") v[i] = 7;
    if (s[i] == "G#") v[i] = 8;
    if (s[i] == "A") v[i] = 9;
    if (s[i] == "B") v[i] = 10;
    if (s[i] == "H") v[i] = 11;
  }
  int temp;
  for (int i = 0; i < 6; i++) {
    int a, b, c;
    a = alist[i];
    b = blist[i];
    c = clist[i];
    if ((v[a] + 7) % 12 == v[c]) {
      if ((v[a] + 4) % 12 == v[b]) {
        cout << "major" << endl;
        return 0;
      } else if ((v[a] + 3) % 12 == v[b]) {
        cout << "minor" << endl;
        return 0;
      }
    }
  }
  cout << "strange" << endl;
  return 0;
}
