#include <bits/stdc++.h>
using namespace std;
int main() {
  int c = 0, cc = 0, d = 0, dd = 0, e = 0, f = 0, ff = 0, g = 0, gg = 0, a = 0,
      b = 0, h = 0, q = 0;
  string str;
  for (int i = 0; i < 3; i++) {
    cin >> str;
    if (str == "C") {
      c++;
    }
    if (str == "C#") {
      cc++;
    }
    if (str == "D") {
      d++;
    }
    if (str == "D#") {
      dd++;
    }
    if (str == "E") {
      e++;
    }
    if (str == "F") {
      f++;
    }
    if (str == "F#") {
      ff++;
    }
    if (str == "G") {
      g++;
    }
    if (str == "G#") {
      gg++;
    }
    if (str == "A") {
      a++;
    }
    if (str == "B") {
      b++;
    }
    if (str == "H") {
      h++;
    }
  }
  if (c == 1 && e == 1 && g == 1) {
    cout << "major" << endl;
    q = 1;
  } else if (cc == 1 && f == 1 && gg == 1) {
    cout << "major" << endl;
    q = 1;
  } else if (d == 1 && ff == 1 && a == 1) {
    cout << "major" << endl;
    q = 1;
  } else if (dd == 1 && g == 1 && b == 1) {
    cout << "major" << endl;
    q = 1;
  } else if (e == 1 && gg == 1 && h == 1) {
    cout << "major" << endl;
    q = 1;
  } else if (f == 1 && a == 1 && c == 1) {
    cout << "major" << endl;
    q = 1;
  } else if (ff == 1 && b == 1 && cc == 1) {
    cout << "major" << endl;
    q = 1;
  } else if (g == 1 && h == 1 && d == 1) {
    cout << "major" << endl;
    q = 1;
  } else if (gg == 1 && c == 1 && dd == 1) {
    cout << "major" << endl;
    q = 1;
  } else if (a == 1 && cc == 1 && e == 1) {
    cout << "major" << endl;
    q = 1;
  } else if (b == 1 && d == 1 && f == 1) {
    cout << "major" << endl;
    q = 1;
  } else if (h == 1 && dd == 1 && ff == 1) {
    cout << "major" << endl;
    q = 1;
  }
  if (c == 1 && dd == 1 && g == 1) {
    cout << "minor" << endl;
    q = 1;
  } else if (cc == 1 && e == 1 && gg == 1) {
    cout << "minor" << endl;
    q = 1;
  } else if (d == 1 && f == 1 && a == 1) {
    cout << "minor" << endl;
    q = 1;
  } else if (dd == 1 && ff == 1 && b == 1) {
    cout << "minor" << endl;
    q = 1;
  } else if (e == 1 && g == 1 && h == 1) {
    cout << "minor" << endl;
    q = 1;
  } else if (f == 1 && gg == 1 && c == 1) {
    cout << "minor" << endl;
    q = 1;
  } else if (ff == 1 && a == 1 && cc == 1) {
    cout << "minor" << endl;
    q = 1;
  } else if (g == 1 && b == 1 && d == 1) {
    cout << "minor" << endl;
    q = 1;
  } else if (gg == 1 && h == 1 && dd == 1) {
    cout << "minor" << endl;
    q = 1;
  } else if (a == 1 && c == 1 && e == 1) {
    cout << "minor" << endl;
    q = 1;
  } else if (b == 1 && cc == 1 && f == 1) {
    cout << "minor" << endl;
    q = 1;
  } else if (h == 1 && d == 1 && ff == 1) {
    cout << "minor" << endl;
    q = 1;
  } else if (q != 1) {
    cout << "strange" << endl;
  }
  return 0;
}
