#include <bits/stdc++.h>
using namespace std;
bool compare(const pair<int, int>& i, const pair<int, int>& j) {
  return i.first < j.first;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  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 aa;
  cin >> aa;
  string bb;
  cin >> bb;
  string cc;
  cin >> cc;
  int c = max({m[aa], m[bb], m[cc]});
  int a = min({m[aa], m[bb], m[cc]});
  int b = m[aa] + m[bb] + m[cc] - a - c;
  if (b - a == 4 && c - b == 3)
    cout << "major";
  else if (b - a == 3 && c - b == 4)
    cout << "minor";
  else if (a + 12 - c == 4 && b - a == 3)
    cout << "major";
  else if (a + 12 - c == 3 && b - a == 4)
    cout << "minor";
  else if (c - b == 4 && a + 12 - c == 3)
    cout << "major";
  else if (c - b == 3 && a + 12 - c == 4)
    cout << "minor";
  else
    cout << "strange";
  return 0;
}
