#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
map<string, int> mp;
string a, b, c;
int chek(string a1, string b1, string c1) {
  int x = (mp[b1] - mp[a1] + 12) % 12;
  int y = (mp[c1] - mp[b1] + 12) % 12;
  int z = (mp[c1] - mp[a1] + 12) % 12;
  if (x == 4 && y == 3 && z == 7) return 1;
  if (x == 3 && y == 4) return 0;
  return -1;
}
int main() {
  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;
  cin >> a >> b >> c;
  if (chek(a, b, c) == 1 || chek(a, c, b) == 1 || chek(b, a, c) == 1 ||
      chek(b, c, a) == 1 || chek(c, a, b) == 1 || chek(c, b, a) == 1)
    cout << "major" << endl;
  else if (chek(a, b, c) == 0 || chek(a, c, b) == 0 || chek(b, a, c) == 0 ||
           chek(b, c, a) == 0 || chek(c, a, b) == 0 || chek(c, b, a) == 0)
    cout << "minor" << endl;
  else
    cout << "strange" << endl;
  return 0;
}
