#include <bits/stdc++.h>
using namespace std;
int main() {
  string arr[12] = {"C",  "C#", "D",  "D#", "E", "F",
                    "F#", "G",  "G#", "A",  "B", "H"};
  string arrr[3];
  for (int i = 0; i < 3; i++) {
    cin >> arrr[i];
  }
  int x, y, z;
  sort(arrr, arrr + 3);
  do {
    for (int j = 0; j < 12; j++) {
      if (arrr[0] == arr[j]) x = j;
      if (arrr[1] == arr[j]) y = j;
      if (arrr[2] == arr[j]) z = j;
    }
    int cont = 0;
    for (int k = x;; k = (k + 1) % 12) {
      if (k == y) break;
      cont++;
    }
    int cont1 = 0;
    for (int k = y;; k = (k + 1) % 12) {
      if (k == z) break;
      cont1++;
    }
    if (cont == 4 && cont1 == 3) {
      cout << "major" << endl;
      return 0;
    } else if (cont == 3 && cont1 == 4) {
      cout << "minor" << endl;
      return 0;
    }
  } while (next_permutation(arrr, arrr + 3));
  cout << "strange" << endl;
  return 0;
}
