#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  map<string, long long int> hash{{"C", 0},  {"C#", 1}, {"D", 2},  {"D#", 3},
                                  {"E", 4},  {"F", 5},  {"F#", 6}, {"G", 7},
                                  {"G#", 8}, {"A", 9},  {"B", 10}, {"H", 11}};
  string a, b, c;
  cin >> a >> b >> c;
  vector<long long int> arr({hash[a], hash[b], hash[c]});
  sort(arr.begin(), arr.end());
  bool ans = false;
  if (arr[1] - arr[0] == 3 && arr[2] - arr[1] == 4) {
    ans = true;
  } else if (arr[2] - arr[1] == 3 && arr[0] + 12 - arr[2] == 4) {
    ans = true;
  } else if (arr[0] + 12 - arr[2] == 3 && arr[1] - arr[0] == 4) {
    ans = true;
  }
  bool major = false;
  if (arr[1] - arr[0] == 4 && arr[2] - arr[1] == 3) {
    major = true;
  } else if (arr[2] - arr[1] == 4 && arr[0] + 12 - arr[2] == 3) {
    major = true;
  } else if (arr[0] + 12 - arr[2] == 4 && arr[1] - arr[0] == 3) {
    major = true;
  }
  if (ans)
    cout << "minor";
  else if (major)
    cout << "major";
  else
    cout << "strange";
}
