#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, c;
  cin >> a >> b >> c;
  vector<string> d;
  d.push_back("C");
  d.push_back("C#");
  d.push_back("D");
  d.push_back("D#");
  d.push_back("E");
  d.push_back("F");
  d.push_back("F#");
  d.push_back("G");
  d.push_back("G#");
  d.push_back("A");
  d.push_back("B");
  d.push_back("H");
  auto i = find(d.begin(), d.end(), a);
  auto j = find(d.begin(), d.end(), b);
  auto k = find(d.begin(), d.end(), c);
  int l, r;
  l = j - i;
  r = k - j;
  if (l < 0) l += 12;
  if (r < 0) r += 12;
  if (l == 4 && r == 3) {
    cout << "major";
    return 0;
  }
  if (l == 3 && r == 4) {
    cout << "minor";
    return 0;
  }
  l = k - i;
  r = j - k;
  if (l < 0) l += 12;
  if (r < 0) r += 12;
  if (l == 4 && r == 3) {
    cout << "major";
    return 0;
  }
  if (l == 3 && r == 4) {
    cout << "minor";
    return 0;
  }
  l = i - j;
  r = k - i;
  if (l < 0) l += 12;
  if (r < 0) r += 12;
  if (l == 4 && r == 3) {
    cout << "major";
    return 0;
  }
  if (l == 3 && r == 4) {
    cout << "minor";
    return 0;
  }
  l = k - j;
  r = i - k;
  if (l < 0) l += 12;
  if (r < 0) r += 12;
  if (l == 4 && r == 3) {
    cout << "major";
    return 0;
  }
  if (l == 3 && r == 4) {
    cout << "minor";
    return 0;
  }
  l = j - k;
  r = i - j;
  if (l < 0) l += 12;
  if (r < 0) r += 12;
  if (l == 4 && r == 3) {
    cout << "major";
    return 0;
  }
  if (l == 3 && r == 4) {
    cout << "minor";
    return 0;
  }
  l = i - k;
  r = j - i;
  if (l < 0) l += 12;
  if (r < 0) r += 12;
  if (l == 4 && r == 3) {
    cout << "major";
    return 0;
  }
  if (l == 3 && r == 4) {
    cout << "minor";
    return 0;
  }
  cout << "strange";
  return 0;
}
