#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s1, s2, s3;
  int a, b, c;
  cin >> s1;
  cin >> s2 >> s3;
  if (s1 == "C") {
    a = 0;
  } else if (s1 == "C#") {
    a = 1;
  } else if (s1 == "D") {
    a = 2;
  } else if (s1 == "D#") {
    a = 3;
  } else if (s1 == "E") {
    a = 4;
  } else if (s1 == "F") {
    a = 5;
  } else if (s1 == "G#") {
    a = 8;
  } else if (s1 == "G") {
    a = 7;
  } else if (s1 == "F#") {
    a = 6;
  } else if (s1 == "A") {
    a = 9;
  } else if (s1 == "B") {
    a = 10;
  } else if (s1 == "H") {
    a = 11;
  }
  if (s2 == "C") {
    b = 0;
  } else if (s2 == "C#") {
    b = 1;
  } else if (s2 == "D") {
    b = 2;
  } else if (s2 == "D#") {
    b = 3;
  } else if (s2 == "E") {
    b = 4;
  } else if (s2 == "F") {
    b = 5;
  } else if (s2 == "G#") {
    b = 8;
  } else if (s2 == "G") {
    b = 7;
  } else if (s2 == "F#") {
    b = 6;
  } else if (s2 == "A") {
    b = 9;
  } else if (s2 == "B") {
    b = 10;
  } else if (s2 == "H") {
    b = 11;
  }
  if (s3 == "C") {
    c = 0;
  } else if (s3 == "C#") {
    c = 1;
  } else if (s3 == "D") {
    c = 2;
  } else if (s3 == "D#") {
    c = 3;
  } else if (s3 == "E") {
    c = 4;
  } else if (s3 == "F") {
    c = 5;
  } else if (s3 == "G#") {
    c = 8;
  } else if (s3 == "G") {
    c = 7;
  } else if (s3 == "F#") {
    c = 6;
  } else if (s3 == "A") {
    c = 9;
  } else if (s3 == "B") {
    c = 10;
  } else if (s3 == "H") {
    c = 11;
  }
  int p = b - a;
  if (p < 0) {
    p += 12;
  }
  int q = c - b;
  if (q < 0) {
    q += 12;
  }
  if ((p == 4 && q == 3))
    cout << "major";
  else if ((p == 3 && q == 4))
    cout << "minor";
  else {
    int p = a - b;
    if (p < 0) {
      p += 12;
    }
    int q = c - a;
    if (q < 0) {
      q += 12;
    }
    if ((p == 4 && q == 3))
      cout << "major";
    else if ((p == 3 && q == 4))
      cout << "minor";
    else {
      int p = c - a;
      if (p < 0) {
        p += 12;
      }
      int q = b - c;
      if (q < 0) {
        q += 12;
      }
      if ((p == 4 && q == 3))
        cout << "major";
      else if ((p == 3 && q == 4))
        cout << "minor";
      else {
        int p = c - b;
        if (p < 0) {
          p += 12;
        }
        int q = a - c;
        if (q < 0) {
          q += 12;
        }
        if ((p == 4 && q == 3))
          cout << "major";
        else if ((p == 3 && q == 4))
          cout << "minor";
        else {
          int p = a - c;
          if (p < 0) {
            p += 12;
          }
          int q = b - a;
          if (q < 0) {
            q += 12;
          }
          if ((p == 4 && q == 3))
            cout << "major";
          else if ((p == 3 && q == 4))
            cout << "minor";
          else {
            int p = b - c;
            if (p < 0) {
              p += 12;
            }
            int q = a - b;
            if (q < 0) {
              q += 12;
            }
            if ((p == 4 && q == 3))
              cout << "major";
            else if ((p == 3 && q == 4))
              cout << "minor";
            else
              cout << "strange";
          }
        }
      }
    }
  }
  return 0;
}
