#include <bits/stdc++.h>
using namespace std;
bool major, minor;
map<string, int> P;
string x, y, z;
int k1, k2;
void go(string x, string y, string z) {
  if (P[x] <= P[y])
    k1 = P[y] - P[x];
  else
    k1 = 12 - P[x] + P[y];
  if (P[y] <= P[z])
    k2 = P[z] - P[y];
  else
    k2 = 12 - P[y] + P[z];
  if (k1 == 4 && k2 == 3)
    major = true;
  else if (k1 == 3 && k2 == 4)
    minor = true;
}
int main(int argc, char *argv[]) {
  P["C"] = 1;
  P["C#"] = 2;
  P["D"] = 3;
  P["D#"] = 4;
  P["E"] = 5;
  P["F"] = 6;
  P["F#"] = 7;
  P["G"] = 8;
  P["G#"] = 9;
  P["A"] = 10;
  P["B"] = 11;
  P["H"] = 12;
  major = false;
  minor = false;
  cin >> x >> y >> z;
  go(x, y, z);
  go(x, z, y);
  go(y, x, z);
  go(y, z, x);
  go(z, x, y);
  go(z, y, x);
  if (major)
    cout << "major" << endl;
  else if (minor)
    cout << "minor" << endl;
  else
    cout << "strange" << endl;
  return 0;
}
