#include <bits/stdc++.h>
using namespace std;
string s[] = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "B", "H"};
map<string, int> mp;
int ok(string s1, string s2, string s3) {
  int a(mp[s1]), b(mp[s2]), c(mp[s3]);
  int k1, k2, k3;
  if (a < b)
    k1 = b - a;
  else
    k1 = b - a + 12;
  if (b < c)
    k2 = c - b;
  else
    k2 = c + 12 - b;
  if (a < c)
    k3 = c - a;
  else
    k3 = c - a + 12;
  if (k1 == 3 && k2 == 4 && k3 == 7)
    return 1;
  else if (k1 == 4 && k2 == 3 && k3 == 7)
    return 2;
  else
    return 0;
}
int go[][3] = {{0, 1, 2}, {0, 2, 1}, {2, 1, 0},
               {1, 2, 0}, {1, 0, 2}, {2, 0, 1}};
int main() {
  for (int i(0); i < 12; ++i) mp[s[i]] = i;
  string ss[3];
  while (cin >> ss[0] >> ss[1] >> ss[2]) {
    int st(0);
    for (int i(0); i < 7; ++i) {
      st = ok(ss[go[i][0]], ss[go[i][1]], ss[go[i][2]]);
      if (st) break;
    }
    if (st == 1)
      cout << "minor\n";
    else if (st == 2)
      cout << "major\n";
    else
      cout << "strange\n";
  }
  return 0;
}
