#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> M;
  M["C"] = 1;
  M["C#"] = 2;
  M["D"] = 3;
  M["D#"] = 4;
  M["E"] = 5;
  M["F"] = 6;
  M["F#"] = 7;
  M["G"] = 8;
  M["G#"] = 9;
  M["A"] = 10;
  M["B"] = 11;
  M["H"] = 12;
  string a, b, c;
  cin >> a >> b >> c;
  int x, y, z;
  x = M[a], y = M[b], z = M[c];
  if (x > y) swap(x, y);
  if (x > z) swap(x, z);
  if (y > z) swap(y, z);
  int q = 0;
  if (y - x == 3 && z - y == 4) q = 1;
  if (z - y == 3 && x - z + 12 == 4) q = 1;
  if (x - z + 12 == 3 && y - x == 4) q = 1;
  if (y - x == 4 && z - y == 3) q = 2;
  if (z - y == 4 && x - z + 12 == 3) q = 2;
  if (x - z + 12 == 4 && y - x == 3) q = 2;
  if (q == 1) puts("minor");
  if (q == 2) puts("major");
  if (!q) puts("strange");
  return 0;
}
