#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-6;
const int INF = 1000000000;
const int maxn = 5 * 200010;
int n, m, T;
string notes[12] = {"C",  "C#", "D",  "D#", "E", "F",
                    "F#", "G",  "G#", "A",  "B", "H"};
map<string, int> nmap;
void init() {
  nmap.clear();
  for (int i = 0; i < 12; i++) nmap.insert(make_pair(notes[i], i));
}
int notesc[3];
int check(int a, int b, int c) {
  if (a > b) a -= 12;
  if (b > c) c += 12;
  if (b - a == 3 && c - b == 4) return 1;
  if (b - a == 4 && c - b == 3) return 2;
  return -1;
}
int main() {
  init();
  string a, b, c;
  cin >> a >> b >> c;
  notesc[0] = nmap[a];
  notesc[1] = nmap[b];
  notesc[2] = nmap[c];
  int ans = -1;
  ans = max(ans, check(notesc[0], notesc[1], notesc[2]));
  ans = max(ans, check(notesc[0], notesc[2], notesc[1]));
  ans = max(ans, check(notesc[1], notesc[0], notesc[2]));
  ans = max(ans, check(notesc[1], notesc[2], notesc[0]));
  ans = max(ans, check(notesc[2], notesc[1], notesc[0]));
  ans = max(ans, check(notesc[2], notesc[0], notesc[1]));
  if (ans == 2)
    cout << "major" << endl;
  else if (ans == 1)
    cout << "minor" << endl;
  else
    cout << "strange" << endl;
  return 0;
}
