#include <bits/stdc++.h>
using namespace std;
int dist(int i1, int i2) {
  if (i2 > i1) {
    return i2 - i1;
  }
  return 12 + i2 - i1;
}
int note(string s) {
  if (s == "C") return 0;
  if (s == "C#") return 1;
  if (s == "D") return 2;
  if (s == "D#") return 3;
  if (s == "E") return 4;
  if (s == "F") return 5;
  if (s == "F#") return 6;
  if (s == "G") return 7;
  if (s == "G#") return 8;
  if (s == "A") return 9;
  if (s == "B") return 10;
  if (s == "H") return 11;
}
int main() {
  string s;
  vector<int> acc;
  for (int i = 0; i < 3; i++) {
    cin >> s;
    acc.push_back(note(s));
  }
  sort(acc.begin(), acc.end());
  int d1 = dist(acc[0], acc[1]);
  int d2 = dist(acc[1], acc[2]);
  if ((d1 == 4) && (d2 == 3)) {
    cout << "major";
    return 0;
  }
  if ((d1 == 3) && (d2 == 4)) {
    cout << "minor";
    return 0;
  }
  while (next_permutation(acc.begin(), acc.end())) {
    d1 = dist(acc[0], acc[1]);
    d2 = dist(acc[1], acc[2]);
    if ((d1 == 4) && (d2 == 3)) {
      cout << "major";
      return 0;
    }
    if ((d1 == 3) && (d2 == 4)) {
      cout << "minor";
      return 0;
    }
  }
  cout << "strange";
  return 0;
}
