#include <bits/stdc++.h>
using namespace std;
int main() {
  string a = "C", b = "C#", c = "D", d = "D#", e = "E", f = "F", g = "F#",
         h = "G", i = "G#", j = "A", k = "B", l = "H";
  string X;
  long long int N1 = 0, N2 = 0, N3 = 0, N4 = 0, N5 = 0, N6 = 0, N7 = 0, N8 = 0,
                N9 = 0, N10 = 0, N11 = 0, N12 = 0;
  for (int p = 0; p < 3; p++) {
    cin >> X;
    if (X == a) {
      N1 = 1;
    } else if (X == b) {
      N2 = 1;
    } else if (X == c) {
      N3 = 1;
    } else if (X == d) {
      N4 = 1;
    } else if (X == e) {
      N5 = 1;
    } else if (X == f) {
      N6 = 1;
    } else if (X == g) {
      N7 = 1;
    } else if (X == h) {
      N8 = 1;
    } else if (X == i) {
      N9 = 1;
    } else if (X == j) {
      N10 = 1;
    } else if (X == k) {
      N11 = 1;
    } else if (X == l) {
      N12 = 1;
    }
  }
  if (N1 == 1 && N5 == 1 && N8 == 1) {
    cout << "major";
  } else if (N2 == 1 && N6 == 1 && N9 == 1) {
    cout << "major";
  } else if (N3 == 1 && N7 == 1 && N10 == 1) {
    cout << "major";
  } else if (N4 == 1 && N8 == 1 && N11 == 1) {
    cout << "major";
  } else if (N5 == 1 && N9 == 1 && N12 == 1) {
    cout << "major";
  } else if (N6 == 1 && N10 == 1 && N1 == 1) {
    cout << "major";
  } else if (N7 == 1 && N11 == 1 && N2 == 1) {
    cout << "major";
  } else if (N8 == 1 && N12 == 1 && N3 == 1) {
    cout << "major";
  } else if (N9 == 1 && N1 == 1 && N4 == 1) {
    cout << "major";
  } else if (N10 == 1 && N2 == 1 && N5 == 1) {
    cout << "major";
  } else if (N11 == 1 && N3 == 1 && N6 == 1) {
    cout << "major";
  } else if (N12 == 1 && N4 == 1 && N7 == 1) {
    cout << "major";
  } else if (N1 == 1 && N4 == 1 && N8 == 1) {
    cout << "minor";
  } else if (N2 == 1 && N5 == 1 && N9 == 1) {
    cout << "minor";
  } else if (N3 == 1 && N6 == 1 && N10 == 1) {
    cout << "minor";
  } else if (N4 == 1 && N7 == 1 && N11 == 1) {
    cout << "minor";
  } else if (N5 == 1 && N8 == 1 && N12 == 1) {
    cout << "minor";
  } else if (N6 == 1 && N9 == 1 && N1 == 1) {
    cout << "minor";
  } else if (N7 == 1 && N10 == 1 && N2 == 1) {
    cout << "minor";
  } else if (N8 == 1 && N11 == 1 && N3 == 1) {
    cout << "minor";
  } else if (N9 == 1 && N12 == 1 && N4 == 1) {
    cout << "minor";
  } else if (N10 == 1 && N1 == 1 && N5 == 1) {
    cout << "minor";
  } else if (N11 == 1 && N2 == 1 && N6 == 1) {
    cout << "minor";
  } else if (N12 == 1 && N3 == 1 && N7 == 1) {
    cout << "minor";
  } else
    cout << "strange";
  return 0;
}
