#include <bits/stdc++.h>
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, 1, -1};
using namespace std;
void solve() {
  string second[12] = {"C",  "C#", "D",  "D#", "E", "F",
                       "F#", "G",  "G#", "A",  "B", "H"};
  string a, b, c;
  cin >> a >> b >> c;
  vector<int> p(12);
  for (int i = 0; i < 12; i++)
    if (second[i] == a || second[i] == b || second[i] == c) p[i] = 1;
  for (int i = 0; i < 12; i++) {
    if (p[i] == 1) {
      if (p[(i + 3) % 12] == 1 && p[(i + 7) % 12] == 1) {
        cout << "minor"
             << "\n";
        return;
      }
      if (p[(i + 4) % 12] == 1 && p[(i + 7) % 12] == 1) {
        cout << "major"
             << "\n";
        return;
      }
    }
  }
  cout << "strange"
       << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
