#include <bits/stdc++.h>
using namespace std;
int main() {
  string arr[12] = {"C",  "C#", "D",  "D#", "E", "F",
                    "F#", "G",  "G#", "A",  "B", "H"};
  string x, y, z;
  int cx, cy, cz, xy, zy;
  cin >> x >> y >> z;
  for (int i = 0; i < 12; i++) {
    if (x == arr[i]) cx = i + 1;
    if (y == arr[i]) cy = i + 1;
    if (z == arr[i]) cz = i + 1;
  }
  if (cy >= cx)
    xy = cy - cx;
  else
    xy = (12 - cx) + cy;
  if (cz >= cy)
    zy = cz - cy;
  else
    zy = (12 - cy) + cz;
  if (xy == 4 && zy == 3) {
    cout << "major";
    return 0;
  } else if (xy == 3 && zy == 4) {
    cout << "minor";
    return 0;
  } else {
    for (int i = 0; i < 5; i++) {
      if (i % 2)
        swap(cx, cy);
      else
        swap(cz, cy);
      if (cy >= cx)
        xy = cy - cx;
      else
        xy = (12 - cx) + cy;
      if (cz >= cy)
        zy = cz - cy;
      else
        zy = (12 - cy) + cz;
      if (xy == 4 && zy == 3) {
        cout << "major";
        return 0;
      } else if (xy == 3 && zy == 4) {
        cout << "minor";
        return 0;
      }
    }
  }
  cout << "strange";
  return 0;
}
