#include <bits/stdc++.h>
using namespace std;
const string notes[12] = {"C",  "C#", "D",  "D#", "E", "F",
                          "F#", "G",  "G#", "A",  "B", "H"};
bool strange = 1;
void print(string *given) {
  int s1 = 0, s2 = 0, s3 = 0;
  int ss1 = 0, ss2 = 0;
  while (given[0] != notes[s1]) {
    s1++;
  }
  while (given[1] != notes[s2]) {
    s2++;
  }
  while (given[2] != notes[s3]) {
    s3++;
  }
  while (notes[s1] != notes[s2]) {
    ss1++;
    s1 = (s1 + 1) % 12;
  }
  while (notes[s2] != notes[s3]) {
    ss2++;
    s2 = (s2 + 1) % 12;
  }
  if (((ss1) == 4) && ((ss2) == 3)) {
    cout << "major" << endl;
    strange = 0;
  } else if (((ss1) == 3) && ((ss2) == 4)) {
    cout << "minor" << endl;
    strange = 0;
  }
}
int main() {
  string given[3];
  int i = 0;
  while (i < 3) {
    cin >> given[i];
    i++;
  }
  sort(given, given + 3);
  do {
    if (strange) print(given);
  } while ((next_permutation(given, given + 3)) && (strange));
  if (strange) cout << "strange\n";
  return 0;
}
