#include <bits/stdc++.h>
using namespace std;
int diff(int a, int b) {
  if (b > a) {
    return b - a;
  } else {
    return 12 - (a - b);
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  string a, b, c;
  cin >> a >> b >> c;
  int x, y, z;
  string arr[13] = {"0",  "C", "C#", "D", "D#", "E", "F",
                    "F#", "G", "G#", "A", "B",  "H"};
  for (int i = 1; i < 13; i++) {
    if (a == arr[i]) {
      x = i;
    }
    if (b == arr[i]) {
      y = i;
    }
    if (c == arr[i]) {
      z = i;
    }
  }
  if (diff(x, y) == 4 && diff(y, z) == 3 && diff(x, z) == 7) {
    cout << "major";
  } else if (diff(x, z) == 4 && diff(z, y) == 3 && diff(x, y) == 7) {
    cout << "major";
  } else if (diff(x, y) == 3 && diff(y, z) == 4 && diff(x, z) == 7) {
    cout << "minor";
  } else if (diff(x, z) == 3 && diff(z, y) == 4 && diff(x, y) == 7) {
    cout << "minor";
  } else if (diff(y, x) == 4 && diff(x, z) == 3 && diff(y, z) == 7) {
    cout << "major";
  } else if (diff(y, z) == 4 && diff(z, x) == 3 && diff(y, x) == 7) {
    cout << "major";
  } else if (diff(y, x) == 3 && diff(x, z) == 4 && diff(y, z) == 7) {
    cout << "minor";
  } else if (diff(y, z) == 3 && diff(z, x) == 4 && diff(y, x) == 7) {
    cout << "minor";
  } else if (diff(z, x) == 4 && diff(x, y) == 3 && diff(z, y) == 7) {
    cout << "major";
  } else if (diff(z, y) == 4 && diff(y, x) == 3 && diff(z, x) == 7) {
    cout << "major";
  } else if (diff(z, x) == 3 && diff(x, y) == 4 && diff(z, y) == 7) {
    cout << "minor";
  } else if (diff(z, y) == 3 && diff(y, x) == 4 && diff(z, x) == 7) {
    cout << "minor";
  } else
    cout << "strange";
}
