#include <bits/stdc++.h>
using namespace std;
string m[12] = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "B", "H"};
int main() {
  string s[3];
  for (int i = 0; i < 3; ++i) cin >> s[i];
  int p[3];
  for (int i = 0; i < 3; ++i)
    for (int j = 0; j < 12; ++j)
      if (m[j] == s[i]) p[i] = j;
  for (int i = 0; i < 6; ++i) {
    next_permutation(p, p + 3);
    int dist[2];
    if (p[1] >= p[0])
      dist[0] = p[1] - p[0];
    else
      dist[0] = 12 + p[1] - p[0];
    if (p[2] >= p[1])
      dist[1] = p[2] - p[1];
    else
      dist[1] = 12 + p[2] - p[1];
    if (dist[0] == 4 && dist[1] == 3) {
      cout << "major";
      return 0;
    }
    if (dist[0] == 3 && dist[1] == 4) {
      cout << "minor";
      return 0;
    }
  }
  cout << "strange";
  return 0;
}
