#include <bits/stdc++.h>
using namespace std;
string s = "CSDTEFVGJABHCSDTEFVGJABH";
int dist(char x, char y) {
  int i = 0;
  int d = 0;
  while (i < s.size()) {
    if (s[i] == x) {
      while (s[i] != y) {
        i++;
        d++;
      }
      return d;
    }
    i++;
  }
}
int main() {
  string x, y, z;
  cin >> x >> y >> z;
  char x1, y1, z1;
  if (x == "C#")
    x1 = 'S';
  else if (x == "D#")
    x1 = 'T';
  else if (x == "F#")
    x1 = 'V';
  else if (x == "G#")
    x1 = 'J';
  else
    x1 = x[0];
  if (y == "C#")
    y1 = 'S';
  else if (y == "D#")
    y1 = 'T';
  else if (y == "F#")
    y1 = 'V';
  else if (y == "G#")
    y1 = 'J';
  else
    y1 = y[0];
  if (z == "C#")
    z1 = 'S';
  else if (z == "D#")
    z1 = 'T';
  else if (z == "F#")
    z1 = 'V';
  else if (z == "G#")
    z1 = 'J';
  else
    z1 = z[0];
  if ((dist(x1, y1) == 4 && dist(y1, z1) == 3) ||
      (dist(x1, z1) == 4 && dist(z1, y1) == 3) ||
      (dist(y1, z1) == 4 && dist(z1, x1) == 3) ||
      (dist(y1, x1) == 4 && dist(x1, z1) == 3) ||
      (dist(z1, x1) == 4 && dist(x1, y1) == 3) ||
      (dist(z1, y1) == 4 && dist(y1, x1) == 3)) {
    cout << "major";
  } else if ((dist(x1, y1) == 3 && dist(y1, z1) == 4) ||
             (dist(x1, z1) == 3 && dist(z1, y1) == 4) ||
             (dist(y1, z1) == 3 && dist(z1, x1) == 4) ||
             (dist(y1, x1) == 3 && dist(x1, z1) == 4) ||
             (dist(z1, x1) == 3 && dist(x1, y1) == 4) ||
             (dist(z1, y1) == 3 && dist(y1, x1) == 4)) {
    cout << "minor";
  } else {
    cout << "strange";
  }
}
