#include <bits/stdc++.h>
using namespace std;
int main() {
  int hit[12];
  string notes[12] = {"C",  "C#", "D",  "D#", "E", "F",
                      "F#", "G",  "G#", "A",  "B", "H"};
  string x, y, z;
  cin >> x >> y >> z;
  for (int i = 0; i < 12; i++) {
    if (x == notes[i] || y == notes[i] || z == notes[i]) {
      hit[i] = 1;
    }
  }
  for (int i = 0; i < 12; i++) {
    if (hit[i] == 1) {
      if (hit[(i + 4) % 12] == 1 && hit[(i + 7) % 12] == 1) {
        cout << "major" << endl;
        return 0;
      } else if (hit[(i + 3) % 12] == 1 && hit[(i + 7) % 12] == 1) {
        cout << "minor" << endl;
        return 0;
      }
    }
  }
  cout << "strange" << endl;
  return 0;
}
