#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<string> v, v1, order;
  vector<int> num;
  int first, second, i, j;
  bool flag = false;
  v.push_back("C");
  v.push_back("C#");
  v.push_back("D");
  v.push_back("D#");
  v.push_back("E");
  v.push_back("F");
  v.push_back("F#");
  v.push_back("G");
  v.push_back("G#");
  v.push_back("A");
  v.push_back("B");
  v.push_back("H");
  for (int i = 0; i < 3; i++) {
    string s;
    cin >> s;
    v1.push_back(s);
  }
  for (i = 0; i < 12; i++) {
    for (j = 0; j < 3; j++) {
      if (v[i] == v1[j]) order.push_back(v[i]);
    }
  }
  v1.clear();
  for (i = 0; i < 3; i++) {
    if (order[i] == "C")
      num.push_back(1);
    else if (order[i] == "C#")
      num.push_back(2);
    else if (order[i] == "D")
      num.push_back(3);
    else if (order[i] == "D#")
      num.push_back(4);
    else if (order[i] == "E")
      num.push_back(5);
    else if (order[i] == "F")
      num.push_back(6);
    else if (order[i] == "F#")
      num.push_back(7);
    else if (order[i] == "G")
      num.push_back(8);
    else if (order[i] == "G#")
      num.push_back(9);
    else if (order[i] == "A")
      num.push_back(10);
    else if (order[i] == "B")
      num.push_back(11);
    else if (order[i] == "H")
      num.push_back(12);
  }
  order.clear();
  for (i = 0; i < 3; i++) {
    if (num[0] <= num[1])
      first = num[1] - num[0];
    else {
      first = 12 - num[0];
      first += num[1];
    }
    if (num[1] <= num[2])
      second = num[2] - num[1];
    else {
      second = 12 - num[1];
      second += num[2];
    }
    if (first == 4 && second == 3) {
      cout << "major" << endl;
      flag = true;
      break;
    } else if (first == 3 && second == 4) {
      cout << "minor" << endl;
      flag = true;
      break;
    } else {
      int temp = num[0];
      num.erase(num.begin());
      num.push_back(temp);
    }
  }
  if (flag == false) cout << "strange" << endl;
  return 0;
}
