#include <bits/stdc++.h>
using namespace std;
int n, t;
string s[3];
string notes[12] = {"C",  "C#", "D",  "D#", "E", "F",
                    "F#", "G",  "G#", "A",  "B", "H"};
int findValue(string a) {
  for (int i = 0; i < 12; i++)
    if (a == notes[i]) return i;
}
string findNote(int i, int j, int k) {
  int X = findValue(s[i]);
  int Y = findValue(s[j]);
  int Z = findValue(s[k]);
  int L = (Y > X ? Y - X : 12 + Y - X);
  int R = (Z > Y ? Z - Y : 12 + Z - Y);
  if (L == 4 and R == 3) return "major";
  if (L == 3 and R == 4) return "minor";
  return "";
}
string solve() {
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++)
      for (int k = 0; k < 3; k++)
        if (i != j and i != k and j != k) {
          string cur = findNote(i, j, k);
          if (cur != "") return cur;
        }
  return "strange";
}
int main() {
  for (int i = 0; i < 3; i++) cin >> s[i];
  cout << solve() << endl;
  return 0;
}
