#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2, s3;
  int i = 0, val[3];
  cin >> s1 >> s2 >> s3;
  cerr << s1 << " " << s2 << " " << s3 << endl;
  for (int z = 0; z < s1.size(); z++) {
    char c = s1[z];
    switch (c) {
      case 'C':
        val[i] = 1;
        break;
      case 'D':
        val[i] = 3;
        break;
      case 'E':
        val[i] = 5;
        break;
      case 'F':
        val[i] = 6;
        break;
      case 'G':
        val[i] = 8;
        break;
      case 'A':
        val[i] = 10;
        break;
      case 'B':
        val[i] = 11;
        break;
      case 'H':
        val[i] = 12;
        break;
      case '#':
        val[i]++;
        break;
    }
  }
  i++;
  for (int z = 0; z < s2.size(); z++) {
    char c = s2[z];
    switch (c) {
      case 'C':
        val[i] = 1;
        break;
      case 'D':
        val[i] = 3;
        break;
      case 'E':
        val[i] = 5;
        break;
      case 'F':
        val[i] = 6;
        break;
      case 'G':
        val[i] = 8;
        break;
      case 'A':
        val[i] = 10;
        break;
      case 'B':
        val[i] = 11;
        break;
      case 'H':
        val[i] = 12;
        break;
      case '#':
        val[i]++;
        break;
    }
  }
  i++;
  for (int z = 0; z < s3.size(); z++) {
    char c = s3[z];
    switch (c) {
      case 'C':
        val[i] = 1;
        break;
      case 'D':
        val[i] = 3;
        break;
      case 'E':
        val[i] = 5;
        break;
      case 'F':
        val[i] = 6;
        break;
      case 'G':
        val[i] = 8;
        break;
      case 'A':
        val[i] = 10;
        break;
      case 'B':
        val[i] = 11;
        break;
      case 'H':
        val[i] = 12;
        break;
      case '#':
        val[i]++;
        break;
    }
  }
  cerr << val[0] << " " << val[1] << " " << val[2] << endl;
  sort(val, val + 3);
  cerr << val[0] << " " << val[1] << " " << val[2] << endl;
  int d1 = val[1] - val[0], d2 = val[2] - val[1], d3 = val[0] + 12 - val[2];
  if ((d1 == 4 && d2 == 3) || (d2 == 4 && d3 == 3) || (d3 == 4 && d1 == 3))
    cout << "major" << endl;
  else if ((d1 == 3 && d2 == 4) || (d2 == 3 && d3 == 4) || (d3 == 3 && d1 == 4))
    cout << "minor" << endl;
  else
    cout << "strange" << endl;
}
