#include <bits/stdc++.h>
using namespace std;
int a[100005];
int main() {
  int n, m, i, j;
  map<string, int> mp;
  mp["C"] = 1;
  mp["C#"] = 2;
  mp["D"] = 3;
  mp["D#"] = 4;
  mp["E"] = 5;
  mp["F"] = 6;
  mp["F#"] = 7;
  mp["G"] = 8;
  mp["G#"] = 9;
  mp["A"] = 10;
  mp["B"] = 11;
  mp["H"] = 12;
  string s[4];
  cin >> s[0] >> s[1] >> s[2];
  int a[4] = {0, 1, 2};
  do {
    int x = mp[s[a[1]]] - mp[s[a[0]]];
    if (x < 0) x += 12;
    int y = mp[s[a[2]]] - mp[s[a[1]]];
    if (y < 0) y += 12;
    if (x == 4 && y == 3)
      return puts("major"), 0;
    else if (x == 3 && y == 4)
      return puts("minor"), 0;
  } while (next_permutation(a, a + 4));
  puts("strange");
}
