#include <bits/stdc++.h>
using namespace std;
int toInt(string s) {
  int res;
  stringstream ss;
  ss << s;
  ss >> res;
  return res;
}
const int inf = 1 << 27;
int main(void) {
  string res[3] = {"major", "minor", "strange"};
  string sx, sy, sz;
  cin >> sx >> sy >> sz;
  map<string, int> m = {{"C", 0},  {"C#", 1}, {"D", 2},  {"D#", 3},
                        {"E", 4},  {"F", 5},  {"F#", 6}, {"G", 7},
                        {"G#", 8}, {"A", 9},  {"B", 10}, {"H", 11}};
  int ans = 2;
  int X = m[sx];
  int Y = m[sy];
  int Z = m[sz];
  vector<int> y = {X + 4, X + 7, X - 4, X - 7, X + 3, X - 3,
                   X + 3, X + 7, X - 3, X - 7, X + 4, X - 4};
  vector<int> z = {X + 7, X + 4, X + 3, X - 3, X - 4, X - 7,
                   X + 7, X + 3, X + 4, X - 4, X - 3, X - 7};
  for (int i = (0); i < (12); ++i) {
    if (y[i] >= 12) y[i] -= 12;
    if (z[i] >= 12) z[i] -= 12;
    if (y[i] < 0) y[i] += 12;
    if (z[i] < 0) z[i] += 12;
  }
  cerr << "X"
       << " = " << (X) << endl;
  cerr << "Y"
       << " = " << (Y) << endl;
  cerr << "Z"
       << " = " << (Z) << endl;
  cerr << "y"
       << " = ";
  for (int __i = (0); __i < ((int((y).size()))); ++__i) {
    cerr << y[__i] << ",";
  }
  cerr << endl;
  cerr << "z"
       << " = ";
  for (int __i = (0); __i < ((int((z).size()))); ++__i) {
    cerr << z[__i] << ",";
  }
  cerr << endl;
  for (int i = (0); i < (12); ++i) {
    if (Y == y[i] && Z == z[i]) {
      cerr << "y[i]"
           << " = " << (y[i]) << endl;
      cerr << "i"
           << " = " << (i) << endl;
      ans = i / 6;
      break;
    }
  }
  cout << res[ans] << endl;
  return 0;
}
