#include <bits/stdc++.h>
using namespace std;
long long mn = 1e9, mx = -1e9, ans, cnt, sm;
bool ok, okk, used[1000010], use[10010];
string s[13] = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "B", "H"};
int getpos(string a) {
  for (int i = 0; i < 12; i++) {
    if (s[i] == a) {
      return i;
    }
  }
}
int dis(string x, string y) {
  int dx = getpos(x);
  int dy = getpos(y);
  if (dy >= dx) {
    return dy - dx;
  } else {
    return 12 + dy - dx;
  }
}
bool maj(string x, string y, string z) {
  return ((dis(x, y) == 4) && (dis(y, z) == 3));
}
bool mnr(string x, string y, string z) {
  return ((dis(x, y) == 3) && (dis(y, z) == 4));
}
int main() {
  string s[10];
  for (int i = 0; i < 3; i++) {
    cin >> s[i];
  }
  sort(s, s + 3);
  do {
    if (maj(s[0], s[1], s[2])) {
      cout << "major";
      return 0;
    } else if (mnr(s[0], s[1], s[2])) {
      cout << "minor";
      return 0;
    }
  } while (next_permutation(s, s + 3));
  cout << "strange";
  return 0;
}
