#include <bits/stdc++.h>
using namespace std;
map<string, int> m;
int dist(string s1, string s2) {
  int x = (m[s2] - m[s1]);
  return ((x < 0) ? (12 + x) : x);
}
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;
  string S[3];
  cin >> S[0] >> S[1] >> S[2];
  int x, y;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      if (j == i) continue;
      for (int k = 0; k < 3; k++) {
        if (k == i || k == j) continue;
        x = dist(S[i], S[j]);
        y = dist(S[j], S[k]);
        if (x == 4 && y == 3) {
          cout << "major";
          return 0;
        } else if (x == 3 && y == 4) {
          cout << "minor";
          return 0;
        }
      }
    }
  }
  cout << "strange";
  return 0;
}
