#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  vector<string> v = {"C",  "C#", "D",  "D#", "E", "F",
                      "F#", "G",  "G#", "A",  "B", "H"};
  for (int i = 12; i < 36; i++) v.push_back(v[i - 12]);
  string a, b, c;
  cin >> a >> b >> c;
  if (!count(v.begin(), v.end(), a) || !count(v.begin(), v.end(), b) ||
      !count(v.begin(), v.end(), c))
    return cout << "strange", 0;
  auto check = [&](string a, string b, string c) {
    int x, y, z;
    for (int i = 0; i < 36; i++)
      if (a == v[i]) {
        x = i;
        break;
      }
    for (int i = x; i < 36; i++)
      if (b == v[i]) {
        y = i;
        break;
      }
    for (int i = y; i < 36; i++)
      if (c == v[i]) {
        z = i;
        break;
      }
    if (y - x == 4 && z - y == 3 && z - x == 7) return 1;
    if (y - x == 3 && z - y == 4 && z - x == 7) return 2;
    return 0;
  };
  if (check(a, b, c))
    cout << (check(a, b, c) == 1 ? "major" : "minor");
  else if (check(a, c, b))
    cout << (check(a, c, b) == 1 ? "major" : "minor");
  else if (check(b, a, c))
    cout << (check(b, a, c) == 1 ? "major" : "minor");
  else if (check(b, c, a))
    cout << (check(b, c, a) == 1 ? "major" : "minor");
  else if (check(c, a, b))
    cout << (check(c, a, b) == 1 ? "major" : "minor");
  else if (check(c, b, a))
    cout << (check(c, b, a) == 1 ? "major" : "minor");
  else
    cout << "strange";
  return 0;
}
