#include <bits/stdc++.h>
using namespace std;
int mas[3];
int def(string str) {
  if (str == "C") return 1;
  if (str == "C#") return 2;
  if (str == "D") return 3;
  if (str == "D#") return 4;
  if (str == "E") return 5;
  if (str == "F") return 6;
  if (str == "F#") return 7;
  if (str == "G") return 8;
  if (str == "G#") return 9;
  if (str == "A") return 10;
  if (str == "B") return 11;
  if (str == "H") return 12;
}
int ret(int f, int s) {
  if (f <= s)
    return s - f;
  else
    return 12 - f + s;
}
int cheak(int f, int s, int k) {
  if (ret(f, s) == 4 && ret(s, k) == 3) {
    cout << "major";
    return 1;
  }
  if (ret(f, s) == 3 && ret(s, k) == 4) {
    cout << "minor";
    return 1;
  }
  return 0;
}
int main() {
  int k = 0;
  for (int i = 0; i < 3; i++) {
    string tmp;
    cin >> tmp;
    mas[i] = def(tmp);
  }
  k += cheak(mas[0], mas[1], mas[2]);
  k += cheak(mas[0], mas[2], mas[1]);
  k += cheak(mas[1], mas[0], mas[2]);
  k += cheak(mas[1], mas[2], mas[0]);
  k += cheak(mas[2], mas[0], mas[1]);
  k += cheak(mas[2], mas[1], mas[0]);
  if (k == 0) cout << "strange";
  return 0;
}
