#include <bits/stdc++.h>
using namespace std;
int count(string x, string y) {
  string arr[12] = {"C",  "C#", "D",  "D#", "E", "F",
                    "F#", "G",  "G#", "A",  "B", "H"};
  int s, e;
  for (int i = 0; i < 12; i++) {
    if (arr[i] == x) s = i;
    if (arr[i] == y) e = i;
  }
  if (e > s) return e - s;
  return 12 - (abs(e - s));
}
int main() {
  bool mj = 0, mn = 0;
  string arr[3];
  cin >> arr[0] >> arr[1] >> arr[2];
  sort(arr, arr + 3);
  do {
    int c1 = count(arr[0], arr[1]);
    int c2 = count(arr[1], arr[2]);
    if (c1 == 4 && c2 == 3) {
      mj = 1;
    } else if (c1 == 3 && c2 == 4) {
      mn = 1;
    }
  } while (next_permutation(arr, arr + 3));
  if (mn && !mj)
    cout << "minor" << endl;
  else if (mj && !mn)
    cout << "major" << endl;
  else
    cout << "strange" << endl;
  return 0;
}
