#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = res * x;
    y = y >> 1;
    x = x * x;
  }
  return res;
}
int gcd(int a, int b) {
  int r = 0;
  if (a < b) {
    swap(a, b);
  }
  if (a == 0) {
    return b;
  } else if (b == 0) {
    return a;
  } else {
    r = a % b;
    while (r != 0) {
      a = b;
      b = r;
      r = a % b;
    }
    return b;
  }
}
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
int fun(string s) {
  int d = 0;
  for (int i = 0; s[i]; i++) d = d * 10 + (s[i] - 48);
  return d;
}
void file() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
int del(int n) {
  int sum = 0, r = 1;
  while (n != 0) {
    int d = n % 10;
    n /= 10;
    if (d != 0) {
      sum += d * r;
      r *= 10;
    }
  }
  return sum;
}
int main() {
  fast();
  int n = 12;
  std::map<std::string, int> mp;
  mp["C"] = 0;
  mp["C#"] = 1;
  mp["D"] = 2;
  mp["D#"] = 3;
  mp["E"] = 4;
  mp["F"] = 5;
  mp["F#"] = 6;
  mp["G"] = 7;
  mp["G#"] = 8;
  mp["A"] = 9;
  mp["B"] = 10;
  mp["H"] = 11;
  string x, y, z;
  cin >> x >> y >> z;
  std::vector<int> v;
  v.push_back(mp[x]);
  v.push_back(mp[y]);
  v.push_back(mp[z]);
  sort(v.begin(), v.end());
  v.push_back(v[0] + n);
  if ((v[1] - v[0] == 4 && v[2] - v[1] == 3) ||
      (v[2] - v[1] == 4 && v[3] - v[2] == 3) ||
      (v[3] - v[2] == 4 && v[1] - v[0] == 3)) {
    cout << "major";
  } else if ((v[1] - v[0] == 3 && v[2] - v[1] == 4) ||
             (v[2] - v[1] == 3 && v[3] - v[2] == 4) ||
             (v[3] - v[2] == 3 && v[1] - v[0] == 4)) {
    cout << "minor";
  } else {
    cout << "strange";
  }
}
