#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long N = 2e2 + 7;
const long long mod = 1e9 + 7;
const long double eps = 1E-7;
long long a, b, n, cnt, mx, ans, c;
long long used[N];
string s[12] = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "B", "H"};
string s1, s2, s3;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> s1 >> s2 >> s3;
  for (int i = 0; i < 12; i++) {
    if (s[i] == s1) a = i;
    if (s[i] == s2) b = i;
    if (s[i] == s3) c = i;
  }
  long long arr[3] = {a, b, c};
  sort(arr, arr + 3);
  do {
    if (arr[0] > arr[1])
      cnt += 11 - arr[0] + arr[1] + 1;
    else
      cnt += arr[1] - arr[0];
    if (arr[1] > arr[2])
      ans += 11 - arr[1] + arr[2] + 1;
    else
      ans += arr[2] - arr[1];
    if (cnt == 4 and ans == 3) return cout << "major", 0;
    if (cnt == 3 and ans == 4) return cout << "minor", 0;
    cnt = 0, ans = 0;
  } while (next_permutation(arr, arr + 3));
  cout << "strange";
}
