#include <bits/stdc++.h>
using namespace std;
map<string, int> m;
int main() {
  m["C"] = 0;
  m["C#"] = 1;
  m["D"] = 2;
  m["D#"] = 3;
  m["E"] = 4;
  m["F"] = 5;
  m["F#"] = 6;
  m["G"] = 7;
  m["G#"] = 8;
  m["A"] = 9;
  m["B"] = 10;
  m["H"] = 11;
  string x, y, z;
  cin >> x >> y >> z;
  int arr[3];
  arr[0] = m[x];
  arr[1] = m[y];
  arr[2] = m[z];
  bool bo = false;
  sort(arr, arr + 3);
  do {
    int d = arr[1] - arr[0];
    int e = arr[2] - arr[1];
    if (d < 0) d += 12;
    if (e < 0) e += 12;
    if (d == 4 && e == 3) {
      puts("major");
      bo = true;
      break;
    } else if (d == 3 && e == 4) {
      puts("minor");
      bo = true;
      break;
    }
  } while (next_permutation(arr, arr + 3));
  if (!bo) puts("strange");
  return 0;
}
