#include <bits/stdc++.h>
using namespace std;
int main() {
  int dif1, dif2;
  map<string, int> weight;
  string x[] = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "B", "H"},
         y[3];
  for (int i = 0; i < 12; i++) {
    weight[x[i]] = i;
  }
  for (int i = 0; i < 3; i++) {
    cin >> y[i];
  }
  sort(y, y + 3);
  dif1 = weight[y[1]] - weight[y[0]];
  if (dif1 < 0) dif1 += 12;
  dif2 = weight[y[2]] - weight[y[1]];
  if (dif2 < 0) dif2 += 12;
  if (dif1 == 4 && dif2 == 3) {
    cout << "major" << endl;
    return 0;
  }
  if (dif1 == 3 && dif2 == 4) {
    cout << "minor" << endl;
    return 0;
  }
  while (next_permutation(y, y + 3)) {
    dif1 = weight[y[1]] - weight[y[0]];
    if (dif1 < 0) dif1 += 12;
    dif2 = weight[y[2]] - weight[y[1]];
    if (dif2 < 0) dif2 += 12;
    if (dif1 == 4 && dif2 == 3) {
      cout << "major" << endl;
      return 0;
    }
    if (dif1 == 3 && dif2 == 4) {
      cout << "minor" << endl;
      return 0;
    }
  }
  cout << "strange" << endl;
}
