#include <bits/stdc++.h>
using namespace std;
void setup() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(15);
}
int main() {
  static const string x[] = {"C",  "C#", "D",  "D#", "E", "F",
                             "F#", "G",  "G#", "A",  "B", "H"};
  string first, second, third;
  cin >> first >> second >> third;
  int f, s, t, i;
  for (i = 0; x[i] != ""; i++)
    if (x[i] == first) break;
  f = i;
  for (i = 0; x[i] != ""; i++)
    if (x[i] == second) break;
  s = i;
  for (i = 0; x[i] != ""; i++)
    if (x[i] == third) break;
  t = i;
  set<int> se;
  se.insert(f);
  se.insert(s);
  se.insert(t);
  int test = f;
  if (se.find((test + 3) % 12) != se.end() &&
      se.find((test + 7) % 12) != se.end()) {
    cout << "minor" << '\n';
    exit(0);
  }
  if (se.find((test + 4) % 12) != se.end() &&
      se.find((test + 7) % 12) != se.end()) {
    cout << "major" << '\n';
    exit(0);
  }
  test = s;
  if (se.find((test + 3) % 12) != se.end() &&
      se.find((test + 7) % 12) != se.end()) {
    cout << "minor" << '\n';
    exit(0);
  }
  if (se.find((test + 4) % 12) != se.end() &&
      se.find((test + 7) % 12) != se.end()) {
    cout << "major" << '\n';
    exit(0);
  }
  test = t;
  if (se.find((test + 3) % 12) != se.end() &&
      se.find((test + 7) % 12) != se.end()) {
    cout << "minor" << '\n';
    exit(0);
  }
  if (se.find((test + 4) % 12) != se.end() &&
      se.find((test + 7) % 12) != se.end()) {
    cout << "major" << '\n';
    exit(0);
  }
  cout << "strange" << '\n';
  return 0;
}
