#include <bits/stdc++.h>
using namespace std;
int to_int(string s) {
  if (s == "C") return 1;
  if (s == "C#") return 2;
  if (s == "D") return 3;
  if (s == "D#") return 4;
  if (s == "E") return 5;
  if (s == "F") return 6;
  if (s == "F#") return 7;
  if (s == "G") return 8;
  if (s == "G#") return 9;
  if (s == "A") return 10;
  if (s == "B") return 11;
  if (s == "H") return 12;
}
int main() {
  string a1, b1, c1;
  cin >> a1 >> b1 >> c1;
  int a[3];
  a[0] = to_int(a1);
  a[1] = to_int(b1);
  a[2] = to_int(c1);
  sort(a, a + 3);
  if (a[2] - a[1] == 3 && a[1] - a[0] == 4) {
    cout << "major";
    return 0;
  }
  if (a[2] - a[1] == 4 && a[1] - a[0] == 3) {
    cout << "minor";
    return 0;
  }
  if (a[1] - a[0] == 3 && a[0] - a[2] + 12 == 4) {
    cout << "major";
    return 0;
  }
  if (a[1] - a[0] == 4 && a[0] - a[2] + 12 == 3) {
    cout << "minor";
    return 0;
  }
  if (a[0] - a[2] + 12 == 3 && a[2] - a[1] == 4) {
    cout << "major";
    return 0;
  }
  if (a[0] - a[2] + 12 == 4 && a[2] - a[1] == 3) {
    cout << "minor";
    return 0;
  }
  cout << "strange";
  return 0;
}
