#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:10000000")
int main(int argc, char *argv[]) {
  map<string, int> mapa;
  mapa["C"] = 0;
  mapa["C#"] = 1;
  mapa["D"] = 2;
  mapa["D#"] = 3;
  mapa["E"] = 4;
  mapa["F"] = 5;
  mapa["F#"] = 6;
  mapa["G"] = 7;
  mapa["G#"] = 8;
  mapa["A"] = 9;
  mapa["B"] = 10;
  mapa["H"] = 11;
  string s;
  int a[3];
  for (int i = 0; i < (3); ++i) {
    cin >> s;
    a[i] = mapa[s];
  }
  sort(a, a + 3);
  bool minor = false;
  bool major = false;
  do {
    if (a[1] == (a[0] + 4) % 12 && a[2] == (a[1] + 3) % 12) {
      major = true;
    }
    if (a[1] == (a[0] + 3) % 12 && a[2] == (a[1] + 4) % 12) {
      minor = true;
    }
  } while (next_permutation(a, a + 3));
  if (!minor && !major)
    printf("strange\n");
  else if (minor && !major)
    printf("minor\n");
  else if (!minor && major)
    printf("major");
  else
    exit(123);
  return 0;
}
