#include <bits/stdc++.h>
using namespace std;
int id(string s) {
  if (s == "C")
    return 1;
  else if (s == "C#")
    return 2;
  else if (s == "D")
    return 3;
  else if (s == "D#")
    return 4;
  else if (s == "E")
    return 5;
  else if (s == "F")
    return 6;
  else if (s == "F#")
    return 7;
  else if (s == "G")
    return 8;
  else if (s == "G#")
    return 9;
  else if (s == "A")
    return 10;
  else if (s == "B")
    return 11;
  else if (s == "H")
    return 12;
}
int Distance(string s, string t) {
  int a = id(s);
  int b = id(t);
  if (b < a) b += 12;
  return b - a;
}
int main() {
  string x, y, z;
  int i, j, k;
  vector<string> v;
  cin >> x >> y >> z;
  v.push_back(x);
  v.push_back(y);
  v.push_back(z);
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      for (k = 0; k < 3; k++) {
        if (Distance(v[i], v[j]) == 4 and Distance(v[j], v[k]) == 3) {
          cout << "major";
          return 0;
        } else if (Distance(v[i], v[j]) == 3 and Distance(v[j], v[k]) == 4) {
          cout << "minor";
          return 0;
        }
      }
    }
  }
  cout << "strange";
  return 0;
}
