#include <bits/stdc++.h>
using namespace std;
map<string, long long> m;
long long x = 0, y = 0;
void funn(string a, string b, string c) {
  if ((m.at(a) - m.at(b) + 12) % 12 == 4 &&
      (m.at(b) - m.at(c) + 12) % 12 == 3) {
    x = 1;
  } else if ((m.at(a) - m.at(b) + 12) % 12 == 3 &&
             (m.at(b) - m.at(c) + 12) % 12 == 4) {
    y = 1;
  }
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  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;
  funn(a, b, c);
  funn(a, c, b);
  funn(b, a, c);
  funn(b, c, a);
  funn(c, b, a);
  funn(c, a, b);
  if (y == 1) {
    cout << "major";
  } else if (x == 1) {
    cout << "minor";
  } else {
    cout << "strange";
  }
  return 0;
}
