#include <bits/stdc++.h>
using namespace std;
int dist(int x, int y) {
  if (y > x)
    return (y - x);
  else
    return (12 - x + y);
}
int main() {
  int i, j, q, r, t;
  string a, b, c;
  cin >> a >> b >> c;
  map<string, int> m;
  m["C"] = 1;
  m["C#"] = 2;
  m["D"] = 3;
  m["D#"] = 4;
  m["E"] = 5;
  m["F"] = 6;
  m["F#"] = 7;
  m["G"] = 8;
  m["G#"] = 9;
  m["A"] = 10;
  m["B"] = 11;
  m["H"] = 12;
  int x, y, z;
  x = m[a];
  y = m[b];
  z = m[c];
  if (dist(x, y) == 3 && dist(y, z) == 4)
    cout << "minor";
  else if (dist(x, y) == 4 && dist(y, z) == 3)
    cout << "major";
  else if (dist(x, z) == 3 && dist(z, y) == 4)
    cout << "minor";
  else if (dist(x, z) == 4 && dist(z, y) == 3)
    cout << "major";
  else if (dist(y, x) == 3 && dist(x, z) == 4)
    cout << "minor";
  else if (dist(y, x) == 4 && dist(x, z) == 3)
    cout << "major";
  else if (dist(y, z) == 3 && dist(z, x) == 4)
    cout << "minor";
  else if (dist(y, z) == 4 && dist(z, x) == 3)
    cout << "major";
  else if (dist(z, x) == 3 && dist(x, y) == 4)
    cout << "minor";
  else if (dist(z, x) == 4 && dist(x, y) == 3)
    cout << "major";
  else if (dist(z, y) == 3 && dist(y, x) == 4)
    cout << "minor";
  else if (dist(z, y) == 4 && dist(y, x) == 3)
    cout << "major";
  else
    cout << "strange";
  return 0;
}
