#include <bits/stdc++.h>
using namespace std;
const int INF = int(1e9);
vector<string> arr = {"C",  "C#", "D",  "D#", "E", "F",
                      "F#", "G",  "G#", "A",  "B", "H"};
int findIndex(string s) {
  return find(arr.begin(), arr.end(), s) - arr.begin();
}
int distance(string a, string b) {
  int i = findIndex(a), j = findIndex(b);
  int res = (j + 12 - i) % 12;
  return res;
}
int main() {
  vector<string> vec(3);
  for (int i = 0; i < 3; i++) cin >> vec[i];
  sort(vec.begin(), vec.end());
  do {
    int a = distance(vec[0], vec[1]);
    int b = distance(vec[1], vec[2]);
    if (a == 4 && b == 3) {
      cout << "major";
      return 0;
    }
    if (a == 3 && b == 4) {
      cout << "minor";
      return 0;
    }
  } while (next_permutation(vec.begin(), vec.end()));
  cout << "strange";
  return 0;
}
