#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, c;
  cin >> a >> b >> c;
  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;
  int arr[3] = {mp[a], mp[b], mp[c]};
  sort(arr, arr + 3);
  if (arr[1] - arr[0] == 4 && arr[2] - arr[1] == 3) {
    cout << "major";
    exit(0);
  }
  if (arr[1] - arr[0] == 3 && arr[2] - arr[1] == 4) {
    cout << "minor";
    exit(0);
  }
  arr[0] = arr[0] + 12;
  sort(arr, arr + 3);
  if (arr[1] - arr[0] == 4 && arr[2] - arr[1] == 3) {
    cout << "major";
    exit(0);
  }
  if (arr[1] - arr[0] == 3 && arr[2] - arr[1] == 4) {
    cout << "minor";
    exit(0);
  }
  arr[0] = arr[0] + 12;
  sort(arr, arr + 3);
  if (arr[1] - arr[0] == 4 && arr[2] - arr[1] == 3) {
    cout << "major";
    exit(0);
  }
  if (arr[1] - arr[0] == 3 && arr[2] - arr[1] == 4) {
    cout << "minor";
    exit(0);
  }
  cout << "strange";
}
