#include <bits/stdc++.h>
using namespace std;
int dist(int p, int q) { return (q - p) < 0 ? (q - p) + 12 : q - p; }
int main() {
  string note[12] = {"C",  "C#", "D",  "D#", "E", "F",
                     "F#", "G",  "G#", "A",  "B", "H"};
  string a, b, c, ans = "strange";
  int p[3], i, j, k;
  int d[3][3];
  cin >> a >> b >> c;
  for (p[0] = 0; p[0] < 12; p[0]++)
    if (note[p[0]] == a) break;
  for (p[1] = 0; p[1] < 12; p[1]++)
    if (note[p[1]] == b) break;
  for (p[2] = 0; p[2] < 12; p[2]++)
    if (note[p[2]] == c) break;
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++) d[i][j] = dist(p[i], p[j]);
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      if (i == j) continue;
      k = 3 - i - j;
      if (d[i][j] == 3 && d[j][k] == 4 && d[i][k] == 7)
        ans = "minor";
      else if (d[i][j] == 4 && d[j][k] == 3 && d[i][k] == 7)
        ans = "major";
    }
  }
  cout << ans << endl;
  return 0;
}
