#include <bits/stdc++.h>
using namespace std;
vector<string> chords;
int dist(string A, string B) {
  int pos = 0;
  while (chords[pos] != A) pos++;
  int ans = 0;
  while (true) {
    if (pos >= 12) pos = 0;
    if (chords[pos] == B) break;
    pos++;
    ans++;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  chords.push_back("C");
  chords.push_back("C#");
  chords.push_back("D");
  chords.push_back("D#");
  chords.push_back("E");
  chords.push_back("F");
  chords.push_back("F#");
  chords.push_back("G");
  chords.push_back("G#");
  chords.push_back("A");
  chords.push_back("B");
  chords.push_back("H");
  vector<string> notes(3);
  cin >> notes[0] >> notes[1] >> notes[2];
  sort(notes.begin(), notes.end());
  bool minor = false;
  bool mayor = false;
  do {
    if (dist(notes[0], notes[1]) == 4 && dist(notes[1], notes[2]) == 3)
      mayor = true;
    else if (dist(notes[0], notes[1]) == 3 && dist(notes[1], notes[2]) == 4)
      minor = true;
  } while (next_permutation(notes.begin(), notes.end()));
  if (minor)
    cout << "minor";
  else if (mayor)
    cout << "major";
  else
    cout << "strange";
  return 0;
}
