#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[12] = {};
  string a, b, c;
  cin >> a >> b >> c;
  string s[12] = {"C",  "C#", "D",  "D#", "E", "F",
                  "F#", "G",  "G#", "A",  "B", "H"};
  for (int x = 1; x <= 12; x++) {
    if (a == s[x - 1] || b == s[x - 1] || c == s[x - 1]) {
      arr[x - 1] = 1;
    }
  }
  int count = 0;
  for (int y = 0; y < 12; y++) {
    if (arr[y] == 1) {
      if (arr[(y + 4) % 12] == 1 && arr[(y + 7) % 12] == 1) {
        count = 1;
        break;
      }
      if (arr[(y + 3) % 12] == 1 && arr[(y + 7) % 12] == 1) {
        count = 2;
        break;
      }
    }
  }
  if (count == 1) {
    cout << "major";
  } else if (count == 2) {
    cout << "minor";
  } else if (count == 0) {
    cout << "strange";
  }
}
