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