#include <bits/stdc++.h>
using namespace std;
template <class T>
void printArray(vector<T> arr) {
  for (T a : arr) cout << a << " ";
  cout << '\n';
}
void printVerdict(bool verdict) { cout << (verdict ? "YES" : "NO") << '\n'; }
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  map<string, int> position;
  int _ = 1;
  for (string s :
       {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "B", "H"}) {
    position[s] = _;
    _++;
  }
  vector<string> triad(3);
  bool major = false, minor = false;
  for (int i = 0; i < 3; i++) cin >> triad[i];
  sort(triad.begin(), triad.end());
  int semitone1 = position[triad[1]] - position[triad[0]],
      semitone2 = position[triad[2]] - position[triad[1]];
  if (semitone1 < 0) semitone1 += 12;
  if (semitone2 < 0) semitone2 += 12;
  if (semitone1 == 4 && semitone2 == 3)
    major = true;
  else if (semitone1 == 3 && semitone2 == 4)
    minor = true;
  while (!major && !minor &&
         next_permutation(triad.begin(), triad.begin() + 3)) {
    semitone1 = position[triad[1]] - position[triad[0]],
    semitone2 = position[triad[2]] - position[triad[1]];
    if (semitone1 < 0) semitone1 += 12;
    if (semitone2 < 0) semitone2 += 12;
    if (semitone1 == 4 && semitone2 == 3)
      major = true;
    else if (semitone1 == 3 && semitone2 == 4)
      minor = true;
  }
  if (major)
    cout << "major" << '\n';
  else if (minor)
    cout << "minor" << '\n';
  else
    cout << "strange" << '\n';
}
