#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<string> s = {"C",  "C#", "D",  "D#", "E", "F",
                      "F#", "G",  "G#", "A",  "B", "H"};
  string in[3];
  int first, second;
  int x, y, z;
  cin >> in[0] >> in[1] >> in[2];
  sort(in, in + 3);
  first = second = 0;
  for (int i = 0; i < 12; i++) {
    if (s[i] == in[0]) x = i;
    if (s[i] == in[1]) y = i;
    if (s[i] == in[2]) z = i;
  }
  for (int i = x;; i = (i + 1) % 12) {
    if (i == y) break;
    first++;
  }
  for (int i = y;; i = (i + 1) % 12) {
    if (i == z) break;
    second++;
  }
  if (first == 4 && second == 3) {
    cout << "major\n";
    return 0;
  } else if (first == 3 && second == 4) {
    cout << "minor\n";
    return 0;
  }
  while (next_permutation(in, in + 3)) {
    first = second = 0;
    for (int i = 0; i < 12; i++) {
      if (s[i] == in[0]) x = i;
      if (s[i] == in[1]) y = i;
      if (s[i] == in[2]) z = i;
    }
    for (int i = x;; i = (i + 1) % 12) {
      if (i == y) break;
      first++;
    }
    for (int i = y;; i = (i + 1) % 12) {
      if (i == z) break;
      second++;
    }
    if (first == 4 && second == 3) {
      cout << "major\n";
      return 0;
    } else if (first == 3 && second == 4) {
      cout << "minor\n";
      return 0;
    }
  }
  cout << "strange\n";
}
