#include <bits/stdc++.h>
using namespace std;
unsigned note_to_digit(char*);
unsigned check(unsigned, unsigned, unsigned);
int main(int argc, char* argv[]) {
  char str[81];
  unsigned arr[3];
  cin >> str;
  arr[0] = note_to_digit(str);
  cin >> str;
  arr[1] = note_to_digit(str);
  cin >> str;
  arr[2] = note_to_digit(str);
  bool flag = 1;
  while (flag) {
    flag = 0;
    for (unsigned i = 0; i < 2; i++) {
      if (arr[i] > arr[i + 1]) {
        flag = 1;
        unsigned tmp = arr[i];
        arr[i] = arr[i + 1];
        arr[i + 1] = tmp;
      }
    }
  }
  if (arr[1] - arr[0] == 3) {
    if (arr[2] - arr[1] == 4) {
      cout << "minor" << endl;
      return 0;
    }
    if (12 - arr[2] + arr[0] == 4) {
      cout << "major" << endl;
      return 0;
    }
  }
  if (arr[1] - arr[0] == 4) {
    if (arr[2] - arr[1] == 3) {
      cout << "major" << endl;
      return 0;
    }
    if (12 - arr[2] + arr[0] == 3) {
      cout << "minor" << endl;
      return 0;
    }
  }
  if (arr[2] - arr[1] == 4) {
    if (12 - arr[2] + arr[0] == 3) {
      cout << "major" << endl;
      return 0;
    }
  }
  if (arr[2] - arr[1] == 3) {
    if (12 - arr[2] + arr[0] == 4) {
      cout << "minor" << endl;
      return 0;
    }
  }
  cout << "strange" << endl;
  return 0;
}
unsigned note_to_digit(char* str) {
  if (strcmp(str, "C") == 0) {
    return 1;
  }
  if (strcmp(str, "C#") == 0) {
    return 2;
  }
  if (strcmp(str, "D") == 0) {
    return 3;
  }
  if (strcmp(str, "D#") == 0) {
    return 4;
  }
  if (strcmp(str, "E") == 0) {
    return 5;
  }
  if (strcmp(str, "F") == 0) {
    return 6;
  }
  if (strcmp(str, "F#") == 0) {
    return 7;
  }
  if (strcmp(str, "G") == 0) {
    return 8;
  }
  if (strcmp(str, "G#") == 0) {
    return 9;
  }
  if (strcmp(str, "A") == 0) {
    return 10;
  }
  if (strcmp(str, "B") == 0) {
    return 11;
  }
  if (strcmp(str, "H") == 0) {
    return 12;
  }
  return 0;
}
