#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[3];
  string s[3];
  for (int i = 0; i < 3; i++) {
    cin >> s[i];
    if (s[i] == "C") {
      a[i] = 1;
      continue;
    } else if (s[i] == "C#") {
      a[i] = 2;
      continue;
    } else if (s[i] == "D") {
      a[i] = 3;
      continue;
    } else if (s[i] == "D#") {
      a[i] = 4;
      continue;
    } else if (s[i] == "E") {
      a[i] = 5;
      continue;
    } else if (s[i] == "F") {
      a[i] = 6;
      continue;
    } else if (s[i] == "F#") {
      a[i] = 7;
      continue;
    } else if (s[i] == "G") {
      a[i] = 8;
      continue;
    } else if (s[i] == "G#") {
      a[i] = 9;
      continue;
    } else if (s[i] == "A") {
      a[i] = 10;
      continue;
    } else if (s[i] == "B") {
      a[i] = 11;
      continue;
    } else if (s[i] == "H") {
      a[i] = 12;
      continue;
    }
  }
  for (int j = 0; j < 3; j++) {
    for (int k = 0; k < 3; k++) {
      if (k == j) continue;
      for (int m = 0; m < 3; m++) {
        if (m == j || m == k)
          continue;
        else {
          if (a[m] < a[k]) a[k] -= 12;
          if (a[k] < a[j]) a[j] -= 12;
          if (a[k] - a[j] == 4 && a[m] - a[k] == 3) {
            cout << "major";
            return 0;
          }
          if (a[k] - a[j] == 3 && a[m] - a[k] == 4) {
            cout << "minor";
            return 0;
          }
        }
      }
    }
  }
  cout << "strange";
  return 0;
}
